Page MenuHomeFreeBSD

Don't sanitize linker_set
ClosedPublic

Authored by matthew.bryan_isilon.com on Nov 5 2019, 3:23 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sat, Apr 5, 10:19 AM
Unknown Object (File)
Mar 14 2025, 8:08 PM
Unknown Object (File)
Mar 14 2025, 4:01 AM
Unknown Object (File)
Mar 11 2025, 9:11 PM
Unknown Object (File)
Mar 10 2025, 6:17 PM
Unknown Object (File)
Mar 2 2025, 12:45 AM
Unknown Object (File)
Feb 27 2025, 7:35 AM
Unknown Object (File)
Feb 26 2025, 11:24 PM
Subscribers

Details

Summary

The assumptions of linker_set don't play nicely with AddressSanitizer. AddressSanitizer adds a 'redzone' of zeros around globals (including those in named sections), whereas linker_set assumes they are all packed consecutively like a pointer array. So: let's annotate linker_set so that AddressSanitizer ignores it.

Adding Konstantin to the review as somebody who touched linker_set recently.

Test Plan

Manual testing to demonstrate that linker_set pointers are consecutive with no redzone. Compiled and ran the kernel and ran few kyua tests for sanity.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Nov 5 2019, 5:55 AM
kib added inline comments.
sys/sys/linker_set.h
65 ↗(On Diff #63949)

I prefer that you put the new attribute after __used.

This revision was automatically updated to reflect the committed changes.