Page MenuHomeFreeBSD

Support BTI in rtld
ClosedPublic

Authored by andrew on Apr 6 2023, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, Nov 3, 8:59 AM
Unknown Object (File)
Sat, Nov 2, 11:53 AM
Unknown Object (File)
Sat, Nov 2, 11:53 AM
Unknown Object (File)
Sat, Nov 2, 11:53 AM
Unknown Object (File)
Sat, Nov 2, 11:42 AM
Unknown Object (File)
Oct 5 2024, 9:44 PM
Unknown Object (File)
Oct 3 2024, 5:19 AM
Unknown Object (File)
Sep 30 2024, 1:57 AM
Subscribers

Details

Reviewers
kib
markj
Group Reviewers
arm64
Commits
rGd8925a5f42b5: Support BTI in rtld
Summary

Read the elf note to decide when to set the guard page on arm64.

Sponsored by: Arm Ltd
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

As with D39449 I've only added digest_note for arm64, but will add a no-op macro on other architectures if there are no issues.

libexec/rtld-elf/aarch64/reloc.c
57

we might pick this up from existing headers:

sys/sys/elf_common.h:#define    ELF_NOTE_GNU            "GNU"
libexec/rtld-elf/rtld.c
1735

I would prefer if you changed the digest_note() name and contract. First, it should indicate that this is MD function, eg. arch_digest_note(). Second, it seems better to call arch_digest_note() as the first thing in the loop body, and expect a bool value as result. Then skip MI processing at all if result is true.

IMO one call is better than spreading it over the whole loop body.

  • Update based on feedback
  • Add arch_digest_note to all architectures
This revision is now accepted and ready to land.Mar 6 2024, 11:17 AM
This revision was automatically updated to reflect the committed changes.