Page MenuHomeFreeBSD

Support BTI in rtld
ClosedPublic

Authored by andrew on Apr 6 2023, 4:10 PM.
Tags
None
Referenced Files
F83536030: D39452.diff
Sat, May 11, 8:13 PM
Unknown Object (File)
Wed, May 8, 8:40 PM
Unknown Object (File)
Tue, May 7, 6:06 PM
Unknown Object (File)
Fri, May 3, 9:30 AM
Unknown Object (File)
Fri, May 3, 6:16 AM
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
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 Skipped
Unit
Tests Skipped
Build Status
Buildable 54252
Build 51142: arc lint + arc unit

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
58

we might pick this up from existing headers:

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

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.