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

rust binaries should not have an executable stack #5643

Closed
thestinger opened this issue Mar 31, 2013 · 2 comments
Closed

rust binaries should not have an executable stack #5643

thestinger opened this issue Mar 31, 2013 · 2 comments
Milestone

Comments

@thestinger
Copy link
Contributor

It seems like an attempt was made to fix this in the past, but it's currently present:

rust W: ELF file ('usr/bin/rust') has executable stack.
rust W: ELF file ('usr/bin/rustc') has executable stack.
rust W: ELF file ('usr/bin/rusti') has executable stack.
rust W: ELF file ('usr/bin/rustdoc') has executable stack.
rust W: ELF file ('usr/bin/rustpkg') has executable stack.
rust W: ELF file ('usr/lib/libstd-4782a756585a81-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/librustc-c84825241471686d-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/libcore-c3ca5d77d81b46c1-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/librusti-5047c7f210c7cac8-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/librust-39583f72884834e3-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/libsyntax-84efebcb12c867a2-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/libstd-4782a756585a81-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/librustc-c84825241471686d-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/libcore-c3ca5d77d81b46c1-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/librusti-5047c7f210c7cac8-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/librust-39583f72884834e3-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/librustdoc-1ac3c0763957e4b0-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/libsyntax-84efebcb12c867a2-0.6.so') has executable stack.
rust W: ELF file ('usr/lib/rustc/x86_64-unknown-linux-gnu/lib/librustpkg-795073e423d025b-0.6.so') has executable stack.

This won't fly on systems like Fedora that use SELinux since it won't allow the binary to run with the default policies.

Clearing the executable stack with execstack still leaves a working set of binaries, so it's definitely not required.

@thestinger
Copy link
Contributor Author

It looks like the linker enables an executable stack when you compile in raw assembly without GNU-stack.

@thestinger
Copy link
Contributor Author

Fixed by #5647.

tesuji pushed a commit to tesuji/rustc that referenced this issue Jun 4, 2020
…ip1995

cargo-ui tests: check that <dir>/src exists before processing test

I forgot that I had fixed this in a PR I closed some days ago (rust-lang#5643).

Before this change, cargo UI tests could fail when switching between branches if the previous branch had a test that the current branch does not have. The directory is not removed when switching because an ignored `Cargo.lock` file exists, and the code was trying to reach `$DIR/src` unconditionally.

This change will just skip a directory that has no `src` subdirectory.

changelog: none
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

No branches or pull requests

1 participant