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

[PAC][AArch64][ELF] Support signed TLSDESC #78

Open
wants to merge 3 commits into
base: dkovalev/pauth-signed-got-mainline
Choose a base branch
from

Conversation

kovdan01
Copy link
Contributor

@kovdan01 kovdan01 commented May 3, 2024

No description provided.

kovdan01 added 3 commits May 3, 2024 15:36
Support the following relocations and assembly operators:

- `R_AARCH64_AUTH_TLSDESC_ADR_PAGE21` (`:tlsdesc_auth:` for `adrp`)
- `R_AARCH64_AUTH_TLSDESC_LD64_LO12` (`:tlsdesc_auth_lo12:` for `ldr`)
- `R_AARCH64_AUTH_TLSDESC_ADD_LO12` (`:tlsdesc_auth_lo12:` for `add`)

`TLSDESC_AUTH_CALLSEQ` pseudo-instruction is introduced which is later expanded
to actual instruction sequence like the following.

```
adrp  x0, :tlsdesc:var
ldr   x16, [x0, #:tlsdesc_lo12:var]
add   x0, x0, #:tlsdesc_lo12:var
autia x16, x0
.tlsdesccall var
blr   x16
(TPIDR_EL0 offset now in x0)
```

FIXME: use BLRAA instead of AUTIA + BLR. BLRAA is currently explicitly
unsupported in AArch64SLSHardening pass.

Only SelectionDAG ISel is supported.

Tests with 'auth' in name have corresponding variants w/o it.
Support `R_AARCH64_AUTH_TLSDESC_ADR_PAGE21`, `R_AARCH64_AUTH_TLSDESC_LD64_LO12`
and `R_AARCH64_AUTH_TLSDESC_LD64_LO12` static TLSDESC relocations.
@kovdan01 kovdan01 requested a review from asl May 3, 2024 12:39
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.

1 participant