Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Missing support for arm64e #39208

Closed
bestbug456 opened this issue May 22, 2020 · 7 comments
Closed

Missing support for arm64e #39208

bestbug456 opened this issue May 22, 2020 · 7 comments

Comments

@bestbug456
Copy link

@bestbug456 bestbug456 commented May 22, 2020

What version of Go are you using (go version)?

$ go version

go version go1.14.3 darwin/amd64

Does this issue reproduce with the latest release?

Yes

What did you do?

I was wondering if arm64e is supported but I didn't see any reference to this architecture after check with go tool dist list and try to build with GOARCH=arm64e I see is not supported yet. Even if is a new architecture, does someone know when or if this arch will be supported by Go?

Kind regards

@martisch
Copy link
Contributor

@martisch martisch commented May 22, 2020

Is arm64e differrent than ARMv8.3?

The later should be compatible with Go GC arm64.
If arm64 does not work please report what happens/or is missing to execute a arm64 Go binary on "arm64e" hardware.

Note that Go GC does not usually compile to specific optional architecture extensions with a separate GOARCH but uses runtime dispatch to use newer instructions.

The minimum requirement for arm64 is

Example for ARMv8.1 atomics:
https://go-review.googlesource.com/c/go/+/81877/

@bestbug456
Copy link
Author

@bestbug456 bestbug456 commented May 22, 2020

Hi martisch from what I've understand if GO already support ARMv8.3 it should already support the arm64e since in armv8.3 the pointer are authenticated which is the main feature I'm interested on. So you are suggesting I'm doing something wrong with CFLAGS/LDFLAGS when I run the compiling process?

@martisch
Copy link
Contributor

@martisch martisch commented May 22, 2020

Im suggesting that for Go GC the right GOARCH to use is arm64. By support I mean that an arm64 compiled go binary should work on ARM8.3.

However I do not think Go GC does anything special about authenticated pointers. Supporting those would be a feature request for that specific arch feature. It would be good to clarify what more precisely is wanted (just assembler instruction support, or do some kernel interfaces need to be called/wrapped differently, should go build compile C code with -msign-return-address using gcc, should Go GC itself sign all return pointers from go functions?...), why this is important in the context of Go and whether there is sufficient hardware available that uses that and would be available for testing and support.

For CFLAGS/LDFLAGS I dont know because I think Go itself would not need those to compile a pure Go binary and there hasnt been anything posted here about the compiling process used and how it fails.

@bestbug456
Copy link
Author

@bestbug456 bestbug456 commented May 22, 2020

Ok martisch thank you so much for the help, I'll write you back with a description about HWD distribution of chipset which support arm64e and a better description regarding the safe pointer functionality.

Cheers

@martisch
Copy link
Contributor

@martisch martisch commented May 22, 2020

I think whats first missing here is what Go should do different from today so "arm64e" is considered to be supported. Does a Go binary compiled for arm64 not work on "arm64e" devices?

@bestbug456
Copy link
Author

@bestbug456 bestbug456 commented May 22, 2020

As far as I know arm64e permit to sign and authenticate pointers to prevent attackers from
escalating memory corruption bugs. A arm64 binary can run on those chipset (since they are an "extension" of arm64) but they can't use the safe pointer feature.
Linux Security Summit -2017:
https://events.static.linuxfound.org/sites/events/files/slides/slides_23.pdf
LLVM Developers' Meeting - 2019:
https://llvm.org/devmtg/2019-10/slides/McCall-Bougacha-arm64e.pdf

@ianlancetaylor
Copy link
Contributor

@ianlancetaylor ianlancetaylor commented May 22, 2020

The arm64e architecture is already supported by Go in the sense that programs built for arm64 will run on arm64e.

The gc compiler does not generate any pointer authentication instructions. As far as I can tell, that shouldn't matter, except that Go programs do not have extra protection against some sorts of stack modification errors.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked pull requests

Successfully merging a pull request may close this issue.

None yet
3 participants
You can’t perform that action at this time.