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)
Wed, Dec 18, 8:07 AM
Unknown Object (File)
Tue, Dec 10, 8:13 AM
Unknown Object (File)
Nov 7 2024, 6:54 AM
Unknown Object (File)
Nov 7 2024, 6:53 AM
Unknown Object (File)
Oct 29 2024, 10:39 PM
Unknown Object (File)
Oct 1 2024, 8:35 PM
Unknown Object (File)
Sep 12 2024, 4:51 PM
Unknown Object (File)
Sep 10 2024, 4:54 PM
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

Lint
Lint Skipped
Unit
Tests Skipped

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.