paxctl(1)
π paxctl β user-space utility to control PaX flags β¨
okay bestie, welcome to paxctl</paxctl> from the PaX manual, section 1. this is the little utility that lets you flip PaX flags on a per-binary basis, and honestly? it's giving gatekeeper energy in the best way. let's get into it π«Ά
β¨ NAME β¨
paxctl β a user-space utility to control PaX flags π
πΈ SYNTAX πΈ
paxctl <flags> <files>
π DESCRIPTION π
paxctl is the tool that lets you modify PaX flags on a per-binary basis. PaX itself is part of the common security-enhancing kernel patches and secure distributions out there β think GrSecurity and Hardened Gentoo, respectively, if you want names.
π¨ real talk though: your system needs to be running a properly patched and configured kernel for this program to have any effect. no patched kernel, no vibes. periodt.
now for the flags, bestie, and there are a lot of them. buckle up π
-Pβ enforce paging based non-executable pages (PAGEEXEC) π₯-pβ do not enforce paging based non-executable pages (NOPAGEEXEC)-Eβ emulate trampolines (EMUTRAMP) π¦-eβ do not emulate trampolines (NOEMUTRAMP)-Mβ enforce secure memory protections (MPROTECT) π‘οΈ-mβ do not enforce secure memory protections (NOMPROTECT)-Rβ randomize memory regions (RANDMMAP) π²-rβ do not randomize memory regions (NORANDMMAP)-Xβ randomize base address of normal (ET_EXEC) executables (RANDEXEC)-xβ do not randomize base address of normal (ET_EXEC) executables (NORANDEXEC)-Sβ enforce segmentation based non-executable pages (SEGMEXEC)-sβ do not enforce segmentation based non-executable pages (NOSEGMEXEC)-vβ view flags π-zβ reset all flags (further flags still apply) π§Ό-cβ create the PT_PAX_FLAGS program header if it does not exist by converting the PT_GNU_STACK program header if it exists β¨-Cβ create the PT_PAX_FLAGS program header if it does not exist by adding a new program header, if it is possible π οΈ-qβ suppress error messages π€«-Qβ report flags in short format π
π CAVEATS π
okay this is the part where we sit down and have a serious little chat, bestie. π
The old PaX flag location and control method have been obsoleted. If your kernel and binaries use it, you have to use chpax(1) instead. (It is recommended to use PT_PAX_FLAGS along with -c or -C however.)
Converting PT_GNU_STACK into PT_PAX_FLAGS means that the information in the former is destroyed π β in particular you must make sure that the EMUTRAMP PaX option is properly set in the newly created PT_PAX_FLAGS. The secure way is to disable EMUTRAMP first and if PaX reports stack execution attempts from nested function trampolines then enable it. like, do it in that order, fr fr.
Note that the new PT_PAX_FLAGS is created in the same state thatbinutils/lditself would produce (equivalent to-zex).
Note that if you use both PT_PAX_FLAGS and the extended attribute PaX flags on a binary then they must be exactly the same (except for RANDEXEC). no cap.
Note that RANDEXEC is no longer supported by PaX kernels since 2.6.13, the paxctl flags are simply ignored there. π
Note that paxctl does not make backup copies of the files it modifies. π like, please back up your own stuff, i am begging.
Note thatpaxctlis meant to work on the native architecture's binaries only, however it should work on foreign binaries as long as they have the same endianess as the native architecture (e.g., an i386paxctlshould work on amd64 or little-endian arm but not on big-endian mips binaries). π
π AUTHOR π
Written by The PaX Team <pageexec@freemail.hu> π
This manpage was adapted from the chpax manpage written by Martin F. Krafft <madduck@debian.org> for the Debian GNU/Linux Distribution, but may be used by others. π«Ά
π₯ SEE ALSO π₯
chpax(1),gradm(8)- PaX website:
http://pax.grsecurity.netπΈ - GrSecurity website:
http://www.grsecurity.netβ - Hardened Gentoo website:
http://www.gentoo.org/proj/en/hardenedπ¦
aaaand that's the whole page, bestie π this one's the paxctl Manual, dated 2012-02-19, and it lives in section paxctl(1) of the PaX docs. go forth and flag responsibly, you icon πβ¨
π¦ where this page comes from
- alpine 3.24: paxctl-doc 0.9-r2 Β· GPL-2.0-only
- nixos 26.05: paxctl 0.9
- nixpkgs unstable: paxctl 0.9
- ubuntu jammy: paxctl 0.9-1build1
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms