Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

icp: mark asm files with noexec stack #5332

Merged
merged 1 commit into from
Oct 25, 2016
Merged

Conversation

perfinion
Copy link
Contributor

Similar to commit a3600a1.
Asm files need an explicit note that they do not require an executable
stack.

This is similar to:
#4962

Similar to commit a3600a1.
Asm files need an explicit note that they do not require an executable
stack.

Signed-off-by: Jason Zaman <[email protected]>
@mention-bot
Copy link

@perfinion, thanks for your PR! By analyzing the history of the files in this pull request, we identified @tonyhutter to be a potential reviewer.

@perfinion
Copy link
Contributor Author

@behlendorf I haven't gotten around to getting a gentoo buildbot setup yet (its on my todo list). I just realized maybe we could just add a readelf thing to the tests. readelf is in binutils so should work on any distro. scanelf (from pax-utils) is even nicer but i dont think every distro has it packaged.

$ find . -name "*.o" -exec readelf -SW {} + | grep "^File\|GNU-stack"
File: ./asm-x86_64/sha2/sha512_impl.o
[ this has no output so it's wrong ]
File: ./icp.o
  [225] .note.GNU-stack   PROGBITS        0000000000000000 6da558 000000 00   X  0   0  0
[ the X here is the problem ]

@perfinion
Copy link
Contributor Author

Looks like fedora has pax-utils too, in that case this is easier. if there are no problems the output is silent.

jason@meriadoc ~/code/kernel/zfs $ scanelf -qyRAF '%e %p' .
--X --- --- /module/icp/icp.ko
!WX --- --- /module/icp/asm-x86_64/sha2/sha512_impl.o
--X --- --- /module/icp/icp.o
!WX --- --- /lib/libicp/asm-x86_64/sha2/sha512_impl.o
!WX --- --- /lib/libicp/asm-x86_64/sha2/.libs/sha512_impl.o
!WX --- --- /lib/libicp/.libs/libicp.a:sha512_impl.o
RWX --- --- /lib/libzpool/.libs/libzpool.so.2.0.0
!WX --- --- /lib/libzpool/.libs/libzpool.a:sha512_impl.o
RWX --- --- /tests/zfs-tests/tests/functional/checksum/sha2_test

@behlendorf
Copy link
Contributor

@perfinion it looks like pax-utils is in EPEL too which is nice because that means we can easily add it to the STYLE builder. How about opening a PR with adds a 'paxcheck' target to the Makefile similar to the cppcheck which is used by the lint target. This will make it very easy to add to the automated testing and make it easy to run locally.

@behlendorf behlendorf merged commit 402c7c2 into openzfs:master Oct 25, 2016
@perfinion perfinion deleted the execstack branch October 26, 2016 03:15
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants