Page MenuHomeFreeBSD

Support BTI in rtld
ClosedPublic

Authored by andrew on Apr 6 2023, 4:10 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, Apr 25, 10:23 PM
Unknown Object (File)
Fri, Apr 12, 2:38 PM
Unknown Object (File)
Mar 18 2024, 4:52 PM
Unknown Object (File)
Mar 7 2024, 7:23 PM
Unknown Object (File)
Dec 20 2023, 5:21 AM
Unknown Object (File)
Dec 14 2023, 7:08 PM
Unknown Object (File)
Aug 23 2023, 12:19 AM
Unknown Object (File)
Jul 2 2023, 2:29 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.