HomeFreeBSD

rtld-elf: Use clear pointer provenance when updating DTV pointer

Description

rtld-elf: Use clear pointer provenance when updating DTV pointer

On traditional architectures where uintptr_t is just a plain integer,
there is no provenance from the order of operations. However, on CHERI
there is even for uintptr_t, and in future this code will use actual
pointer types anyway, where the provenance does technically matter even
for non-CHERI. Commute and associate the operands appropriately to
ensure the provenance is for the new allocation, not the old one.

Reviewed by: kib
Differential Revision: https://reviews.freebsd.org/D50230

Details

Provenance
jrtc27Authored on May 7 2025, 7:20 PM
Reviewer
kib
Differential Revision
D50230: rtld-elf: Use clear pointer provenance when updating DTV pointer
Parents
rGb209947fc27c: rtld-elf: Use struct tcb * rather than uintptr_t ** for the tcb
Branches
Unknown
Tags
Unknown