Page MenuHomeFreeBSD

elfctl: fix operations with multiple features on multiple files
ClosedPublic

Authored by emaste on Feb 15 2022, 3:49 AM.
Tags
None
Referenced Files
F132438103: D34283.id102776.diff
Thu, Oct 16, 10:59 PM
Unknown Object (File)
Sep 11 2025, 11:36 PM
Unknown Object (File)
Aug 22 2025, 3:25 AM
Unknown Object (File)
Aug 19 2025, 12:28 AM
Unknown Object (File)
Aug 4 2025, 8:16 AM
Unknown Object (File)
Jul 7 2025, 8:48 AM
Unknown Object (File)
Jul 7 2025, 7:45 AM
Unknown Object (File)
Jun 27 2025, 10:47 AM
Subscribers

Details

Summary

Previously an invocation like elfctl -e +feature1,feature2 file1 file2 would set both feature flags in file 1 but only feature1 in file2 due to strsep().

Reported by: jrm
MFC after: 3 days
Sponsored by: The FreeBSD Foundation

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

emaste created this revision.

Looks good from a testing perspective.

jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % sudo ./elfctl -e '+noaslr,wxneeded' /usr/local/bin/ztop /usr/local/bin/zstd
jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % ./elfctl /usr/local/bin/ztop /usr/local/bin/zstd | grep 'noaslr\|wxneeded'
noaslr          'Disable ASLR' is set.
wxneeded        'Requires W+X mappings' is set.
noaslr          'Disable ASLR' is set.
wxneeded        'Requires W+X mappings' is set.
jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % sudo ./elfctl -e '-noaslr,wxneeded' /usr/local/bin/ztop /usr/local/bin/zstd
jrm@phe /usr/obj/usr/src/amd64.amd64/usr.bin/elfctl % ./elfctl /usr/local/bin/ztop /usr/local/bin/zstd | grep 'noaslr\|wxneeded'
noaslr          'Disable ASLR' is unset.
wxneeded        'Requires W+X mappings' is unset.
noaslr          'Disable ASLR' is unset.
wxneeded        'Requires W+X mappings' is unset.

There are a few minor, pre-existing whitespace issues (space inserted next to a tab) on lines 85, 409, 448.

This revision was not accepted when it landed; it landed in state Needs Review.Feb 15 2022, 1:43 PM
This revision was automatically updated to reflect the committed changes.