-
Notifications
You must be signed in to change notification settings - Fork 13.3k
remove unnecessary PaX detection #14850
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
Conversation
Rust no longer has support for JIT compilation, so it doesn't currently require a PaX MPROTECT exception. The extended attributes are preferred over modifying the binaries so it's not actually going to work on most systems like this anyway. If JIT compilation ends up being supported again, it should handle this by *always* applying the exception via an extended attribute without performing auto-detection of PaX on the host. The `paxctl` tool is only necessary with the older method involving modifying the ELF binary.
It seems like MPROTECT still needs to be disabled after all. Specifically, running diff --git a/src/test/run-make/relocation-model/Makefile b/src/test/run-make/relocation-model/Makefile
index 2fcdd32..2d9ddb0 100644
--- a/src/test/run-make/relocation-model/Makefile
+++ b/src/test/run-make/relocation-model/Makefile
@@ -5,9 +5,11 @@ all:
> $(call RUN,foo)
$
> $(RUSTC) -C relocation-model=default foo.rs
+> paxctl -czexm $(TMPDIR)/foo
> $(call RUN,foo)
$
> $(RUSTC) -C relocation-model=static foo.rs
+> paxctl -czexm $(TMPDIR)/foo
> $(call RUN,foo)
$
> $(RUSTC) -C relocation-model=default --crate-type=dylib foo.rs The tests pass if the patch above is used, but I'm not sure if this should only be patched in the test's Makefile or if rustc itself should call paxctl. This was on a 64-bit system, BTW. Additionally, if Rust is compiled with a 32-bit userland on a 64-bit kernel (which I'm using for testing), I can't even get rustc to compile, as it fails with a similar error during the build:
|
The following FAQ has more info about this issue: Based on my reading of the FAQ, disabling MPROTECT is probably not the best way to handle the errors above, although I'm not sure what is the best way to fix it. I'm not using Gentoo, BTW. |
The test case is broken because it's mixing the static relocation model with dynamic linking. |
The issue you're reporting has nothing to do with this old |
ide : Disallow renaming of non-local items fixes rust-lang#14850 . This makes me wonder , why stop at structs and not do the same for other ADTs? Would be happy to add them too if nothing speaks against it.
Rust no longer has support for JIT compilation, so it doesn't currently
require a PaX MPROTECT exception. The extended attributes are preferred
over modifying the binaries so it's not actually going to work on most
systems like this anyway.
If JIT compilation ends up being supported again, it should handle this
by always applying the exception via an extended attribute without
performing auto-detection of PaX on the host. The
paxctl
tool is onlynecessary with the older method involving modifying the ELF binary.