.\" $NetBSD: paxctl.8,v 1.16.24.1 2023/06/27 18:20:18 martin Exp $ .\" .\" Copyright 2006 Elad Efrat .\" Copyright 2008 Christos Zoulas .\" All rights reserved. .\" .\" 1. Redistributions of source code must retain the above copyright .\" notice, this list of conditions and the following disclaimer. .\" 2. Redistributions in binary form must reproduce the above copyright .\" notice, this list of conditions and the following disclaimer in the .\" documentation and/or other materials provided with the distribution. .\" 3. The name of the author may not be used to endorse or promote products .\" derived from this software without specific prior written permission. .\" .\" THIS SOFTWARE IS PROVIDED BY THE AUTHOR ``AS IS'' AND ANY EXPRESS OR .\" IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES .\" OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. .\" IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY DIRECT, INDIRECT, .\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT .\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, .\" DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY .\" THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT .\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF .\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. .\" .Dd June 23, 2023 .Dt PAXCTL 8 .Os .Sh NAME .Nm paxctl .Nd list and modify PaX flags associated with an ELF program .Sh SYNOPSIS .Nm .Op Fl 0 | Cm flags .Ar program ... .Sh DESCRIPTION The .Nm utility is used to list and manipulate PaX flags associated with an ELF program. The PaX flags signify to the loader the privilege protections to be applied to mapped memory pages, and fuller explanations of the specific protections can be found in the .Xr security 7 manpage. .Pp If .Fl 0 option is specified, all PaX flags (including reserved bits) are cleared. Otherwise, each flag can be prefixed either with a .Dq + or a .Dq - sign to add or remove the flag, respectively. .Pp The following flags are available: .Bl -tag -width flag .It a Explicitly disable PaX ASLR (Address Space Layout Randomization) for .Ar program . .It A Explicitly enable PaX ASLR for .Ar program . .It g Explicitly disable PaX Segvguard for .Ar program . .It G Explicitly enable PaX Segvguard for .Ar program . .It m Explicitly disable PaX MPROTECT .Po Xr mprotect 2 restrictions .Pc for .Ar program . .It M Explicitly enable PaX MPROTECT .Po Xr mprotect 2 restrictions .Pc for .Ar program . .El .Pp To view existing flags on a file, execute .Nm without any flags. .Sh SEE ALSO .Xr mprotect 2 , .Xr sysctl 3 , .Xr options 4 , .Xr elf 5 , .Xr security 7 , .Xr sysctl 8 , .Xr fileassoc 9 .Sh HISTORY The .Nm utility first appeared in .Nx 4.0 . .Pp The .Nm utility is modeled after a tool of the same name available for Linux from the PaX project. .Sh AUTHORS .An Elad Efrat Aq Mt elad@NetBSD.org .An Christos Zoulas Aq Mt christos@NetBSD.org .Sh BUGS The .Nm utility currently uses .Xr elf 5 .Dq note sections to mark executables as having PaX flags enabled. This will be done using .Xr fileassoc 9 in the future so that we can control who does the marking and not altering the binary file signature. (Note this also means that at present any flags set do not survive binary file upgrades.)