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

[PAUTHABIELF64] Possible typo in R_AARCH64_AUTH_GOT_LO12_NC #253

Closed
kovdan01 opened this issue Mar 25, 2024 · 4 comments
Closed

[PAUTHABIELF64] Possible typo in R_AARCH64_AUTH_GOT_LO12_NC #253

kovdan01 opened this issue Mar 25, 2024 · 4 comments

Comments

@kovdan01
Copy link

In https://github.com/ARM-software/abi-aa/blob/main/pauthabielf64/pauthabielf64.rst#auth-variant-got-generating-relocations, AUTH variants of GOT-generating relocations are defined. Their names are in most cases basically the same as corresponding non-AUTH relocs names, but for R_AARCH64_AUTH_GOT_LO12_NC, it's not true: the non-AUTH variant contains LD64 (R_<CLS>_LD64_GOT_LO12_NC), so the AUTH variant should probably be R_AARCH64_AUTH_LD64_GOT_LO12_NC. If LD64 is considered redundant since we don't have 32-bit versions of AUTH relocations, it should be probably deleted from other AUTH relocs names: in R_AARCH64_AUTH_LD64_GOTOFF_LO15 and R_AARCH64_AUTH_LD64_GOTPAGE_LO15, LD64 is present.

Is LD64 omitted in R_AARCH64_AUTH_GOT_LO12_NC intentionally? If yes, it would be nice if you explain rationale of such decision.

@kovdan01
Copy link
Author

Tagging @smithp35
Tagging @asl

@smithp35
Copy link
Contributor

I'm on vacation this week. Will get back to you after Easter.

It is most likely a typo, my memory is that I wanted to match the existing dynamic relocations. I'll check when I get back to see if there is any other reason.

smithp35 added a commit to smithp35/abi-aa that referenced this issue Apr 2, 2024
As pointed out in ARM-software#253
the R_AARCH64_AUTH_GOT_LO12_NC is meant to be the AUTH variant of
R_AARCH64_LD64_GOT_LO12_NC. As there is also a
R_AARCH64_LD32_GOT_LO12_NC relocation rename the relocation to
R_AARCH64_LD64_AUTH_GOT_LO12_NC.

These relocations are in the appendix as we are currently
expecting the GOT to be RELRO and unsigned in most signing schemas.
@smithp35
Copy link
Contributor

smithp35 commented Apr 2, 2024

I agree this is a typo. I've created #255 to fix.

To the best of my knowledge the Appendix on GOT generating relocations hasn't been implemented before. At the time of writing the interested parties preferred to have a RELRO unsigned GOT.

smithp35 added a commit to smithp35/abi-aa that referenced this issue Apr 3, 2024
There is no equivalent for this relocation in the standard ABI
it could be used for runtime code to calculate the address of
a GOT slot in a similar way to obtaining the address of a
static data item. However there is no way to express the
address of a GOT slot in source code, and the compiler can
use a load to get the contents of the GOT slot directly
without first calculating the address.

Part of ARM-software#253
smithp35 added a commit to smithp35/abi-aa that referenced this issue Apr 15, 2024
There is no equivalent for this relocation in the standard ABI
it is used by runtime code to calculate the address of
a GOT slot so it can be used as one of the inputs to an
authenticate instruction. Add a note that this matches up
with the :got_auth_lo12: operator for future reference.

Part of ARM-software#253
smithp35 added a commit that referenced this issue Jul 2, 2024
As pointed out in #253
the R_AARCH64_AUTH_GOT_LO12_NC is meant to be the AUTH variant of
R_AARCH64_LD64_GOT_LO12_NC. As there is also a
R_AARCH64_LD32_GOT_LO12_NC relocation rename the relocation to
R_AARCH64_LD64_AUTH_GOT_LO12_NC.

These relocations are in the appendix as we are currently
expecting the GOT to be RELRO and unsigned in most signing schemas.
smithp35 added a commit that referenced this issue Jul 2, 2024
There is no equivalent for this relocation in the standard ABI
it is used by runtime code to calculate the address of
a GOT slot so it can be used as one of the inputs to an
authenticate instruction. Add a note that this matches up
with the :got_auth_lo12: operator for future reference.

Part of #253
@kovdan01
Copy link
Author

Closing the issue as resolved in #255

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

No branches or pull requests

2 participants