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

[pauthabi64][aaelf64] Move PAuth GOT relocs out of private space #300

Merged
merged 2 commits into from
Jan 10, 2025

Conversation

smithp35
Copy link
Contributor

In the initial draft relocations for signing GOT entries were
defined in the private space reserved for experiments. It was not
known if these relocations would be useful as if RELRO is supported
the GOT does not need to be signed. There is now at least one user
of the GOT signing relocations so we should move the relocations
out of the private space and into the space reserved for the
PAuthABI.

This PR includes relocations added in
#295

Fixes: #298

kovdan01 added a commit to kovdan01/llvm-project that referenced this pull request Dec 1, 2024
kovdan01 added a commit to llvm/llvm-project that referenced this pull request Dec 2, 2024
TIFitis pushed a commit to TIFitis/llvm-project that referenced this pull request Dec 18, 2024
@smithp35
Copy link
Contributor Author

smithp35 commented Jan 9, 2025

I'm working on a rebase of this PR.

In the initial draft relocations for signing GOT entries were
defined in the private space reserved for experiments. It was not
known if these relocations would be useful as if RELRO is supported
the GOT does not need to be signed. There is now at least one user
of the GOT signing relocations so we should move the relocations
out of the private space and into the space reserved for the
PAuthABI.

This PR includes relocations added in
ARM-software#295

Fixes: ARM-software#298
@smithp35 smithp35 force-pushed the renumber-pauth-relocs branch from 6b15b45 to 5ed7ee4 Compare January 9, 2025 17:26
@@ -1117,80 +1120,80 @@ The GOT entries must be relocated by AUTH variant dynamic relocations.
+-------------+----------------------------------------+----------------------------------------+--------------------------+
| ELF 64 Code | Name | Operation | Comment |
+=============+========================================+========================================+==========================+
| 0x8110 | R\_AARCH64\_AUTH\_MOVW\_GOTOFF\_G0 | G(ENCD(GDAT(S))) - GOT | Set a MOV[NZ] immediate |
| 0x245 | R\_AARCH64\_AUTH\_MOVW\_GOTOFF\_G0 | G(ENCD(GDAT(S))) - GOT | Set a MOV[NZ] immediate |
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Very much a nit, but for the sanity of people that cross reference aaelf64 and pauthabielf64 documentation, it'd be nice if the ELF code in this doc wasn't written in hex.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I originally wrote it in hex as LLVM (only implementation of PAuthABI defines relocation numbers in hex so this made it easier to cross-check the implementation. Just thinking if it is worth writing both? For example 0x245 (581)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yea, sounds good to me.

Add a decimal representation of the relocation code alongside the
relocation code for easier cross-reference with AAELF64.

The PAuthABI uses hex for the relocation codes as the only
implementation LLVM uses hex in the relocation definitions. This
makes it easier to cross-reference. Adding the decimal in
parentheses satisfies both forms of cross-reference.
Copy link
Member

@stuij stuij left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@smithp35 smithp35 merged commit 05abf4f into ARM-software:main Jan 10, 2025
1 check passed
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

Successfully merging this pull request may close these issues.

[pauthabielf64] Move signed GOT relocs from private to public space
2 participants