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
Unknown Object (File)
Tue, Oct 1, 8:35 PM
Unknown Object (File)
Thu, Sep 12, 4:51 PM
Unknown Object (File)
Sep 10 2024, 4:54 PM
Unknown Object (File)
Sep 2 2024, 2:51 PM
Unknown Object (File)
Aug 30 2024, 4:06 PM
Unknown Object (File)
Aug 30 2024, 3:26 PM
Unknown Object (File)
Jul 26 2024, 8:49 PM
Unknown Object (File)
Jun 22 2024, 5:08 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.