Skip to content

Commit d884cc8

Browse files
thestingeralexcrichton
authored andcommitted
remove unnecessary PaX detection
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.
1 parent ac7b9dd commit d884cc8

File tree

2 files changed

+0
-56
lines changed

2 files changed

+0
-56
lines changed

configure

Lines changed: 0 additions & 52 deletions
Original file line numberDiff line numberDiff line change
@@ -416,7 +416,6 @@ opt mingw-cross 0 "cross-compile for win32 using mingw"
416416
opt clang 0 "prefer clang to gcc for building the runtime"
417417
opt ccache 0 "invoke gcc/clang via ccache to reuse object files between builds"
418418
opt local-rust 0 "use an installed rustc rather than downloading a snapshot"
419-
opt pax-flags 0 "apply PaX flags to rustc binaries (required for GRSecurity/PaX-patched kernels)"
420419
opt inject-std-version 1 "inject the current compiler version of libstd into programs"
421420
opt llvm-static-stdcpp 0 "statically link to libstdc++ for LLVM"
422421
opt rpath 1 "build rpaths into rustc itself"
@@ -518,12 +517,6 @@ then
518517
fi
519518
fi
520519

521-
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
522-
then
523-
probe CFG_PAXCTL paxctl /sbin/paxctl
524-
probe CFG_ZCAT zcat
525-
fi
526-
527520
step_msg "looking for target specific programs"
528521

529522
probe CFG_ADB adb
@@ -546,51 +539,6 @@ then
546539
fi
547540
fi
548541

549-
if [ "$CFG_OSTYPE" = "unknown-linux-gnu" ]
550-
then
551-
if [ ! -z "$CFG_ENABLE_PAX_FLAGS" -a -z "$CFG_PAXCTL" ]
552-
then
553-
err "enabled PaX markings but no paxctl binary found"
554-
fi
555-
556-
if [ -z "$CFG_DISABLE_PAX_FLAGS" ]
557-
then
558-
# GRSecurity/PaX detection. This can be very flaky.
559-
GRSEC_DETECTED=
560-
561-
# /dev/grsec only exists if CONFIG_GRKERNSEC_NO_RBAC is not set.
562-
# /proc/sys/kernel/grsecurity is not available if ÇONFIG_GRKERNSEC_SYSCTL is not set.
563-
if [ -e /dev/grsec -o -d /proc/sys/kernel/grsecurity ]
564-
then
565-
GRSEC_DETECTED=1
566-
# /proc/config.gz is normally only available to root, and only if CONFIG_IKCONFIG_PROC has been set.
567-
elif [ -r /proc/config.gz -a ! -z "$CFG_ZCAT" ]
568-
then
569-
if "$CFG_ZCAT" /proc/config.gz | grep --quiet "CONFIG_GRKERNSEC=y"
570-
then
571-
GRSEC_DETECTED=1
572-
fi
573-
# Flaky.
574-
elif grep --quiet grsec /proc/version
575-
then
576-
GRSEC_DETECTED=1
577-
fi
578-
579-
if [ ! -z "$GRSEC_DETECTED" ]
580-
then
581-
step_msg "GRSecurity: yes"
582-
if [ ! -z "$CFG_PAXCTL" ]
583-
then
584-
CFG_ENABLE_PAX_FLAGS=1
585-
else
586-
warn "GRSecurity kernel detected but no paxctl binary found: not setting CFG_ENABLE_PAX_FLAGS"
587-
fi
588-
else
589-
step_msg "GRSecurity: no"
590-
fi
591-
fi
592-
fi
593-
594542
BIN_SUF=
595543
if [ "$CFG_OSTYPE" = "pc-mingw32" ] || [ "$CFG_OSTYPE" = "w64-mingw32" ]
596544
then

mk/stage0.mk

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,6 @@ ifdef CFG_ENABLE_LOCAL_RUST
1818
$(Q)$(S)src/etc/local_stage0.sh $(CFG_BUILD) $(CFG_LOCAL_RUST_ROOT) rustlib
1919
else
2020
$(Q)$(CFG_PYTHON) $(S)src/etc/get-snapshot.py $(CFG_BUILD) $(SNAPSHOT_FILE)
21-
ifdef CFG_ENABLE_PAX_FLAGS
22-
@$(call E, apply PaX flags: $@)
23-
@"$(CFG_PAXCTL)" -cm "$@"
24-
endif
2521
endif
2622
$(Q)touch $@
2723

0 commit comments

Comments
 (0)