Page MenuHomeFreeBSD

libsys: Implement safe aux vec initialization
Needs ReviewPublic

Authored by aokblast on Mar 17 2026, 6:40 AM.
Tags
None
Referenced Files
F166331492: D55891.id173787.diff
Wed, Aug 12, 11:20 PM
Unknown Object (File)
Tue, Aug 11, 11:29 PM
Unknown Object (File)
Mon, Aug 10, 10:54 AM
Unknown Object (File)
Sun, Aug 9, 3:45 PM
Unknown Object (File)
Sun, Aug 9, 1:41 AM
Unknown Object (File)
Sat, Aug 8, 5:08 PM
Unknown Object (File)
Fri, Aug 7, 11:14 PM
Unknown Object (File)
Fri, Aug 7, 7:56 PM
Subscribers

Details

Reviewers
dim
kib
jrtc27
Summary

In llvm sanitizer, we directly refenrece the aux vector by using weak
symbol since some of the aux info does not appeared in elf_aux_info.
However, since the elf_aux_vector is lazy initialzed, it is possible
that
elf_aux_vector will be NULL if the sanitizer initialize early
enough. Therefore, we provide a function to allow external user of
__elf_aux_vector to be properly initilized.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 71446
Build 68329: arc lint + arc unit

Event Timeline

lib/libsys/Symbol.map
7

why do you need the prefixed private symbol?

In fact, I think that it is ok but should have two underscores. And I prefer that we do not export any stable interface for this, i.e. remove the libsys_elf_aux_vec_addr from the version as well as the alias. Use __libsys_.. in the santitizer, which already knows to much about the C runtime internals anyway.

Also remove the proto from the public header.