PR_MPX_ENABLE_MANAGEMENT(2const)
π PR_MPX_ENABLE_MANAGEMENT π
okay bestie, welcome to the manual page for PR_MPX_ENABLE_MANAGEMENT and PR_MPX_DISABLE_MANAGEMENT β the duo whose whole job is turning kernel management of Memory Protection eXtensions (MPX) on and off. this is part of section 2const of the Linux man-pages, and yes she is a const page, she's that girl. π
β¨ LIBRARY β¨
Standard C library (libc, -lc). your fave, your ride or die. π«Ά
π¦ SYNOPSIS π¦
#include <linux/prctl.h> /* Definition of PR_* constants */
#include <sys/prctl.h>
[[deprecated]] int prctl(PR_MPX_ENABLE_MANAGEMENT, 0L, 0L, 0L, 0L);
[[deprecated]] int prctl(PR_MPX_DISABLE_MANAGEMENT, 0L, 0L, 0L, 0L);
not me pointing out that literally both of these are marked [[deprecated]]... the compiler is screaming at you and honestly it's valid. π
π DESCRIPTION π
so what do these actually do? they enable or disable kernel management of the Memory Protection eXtensions (MPX) bounds tables. that's the whole vibe.
MPX is a hardware-assisted mechanism for doing bounds checking on pointers β it's giving security guard energy, but in silicon. it's made up of two things: a set of registers that store bounds information, and a set of special instruction prefixes that tell the CPU on which instructions it should do bounds enforcement.
here's the tea though: there is a limited number of these registers. and when there are more pointers than registers (which happens, it always happens), their contents must be "spilled" into a set of tables. those tables are literally called "bounds tables", and the MPX prctl() operations are the ones that control whether the kernel manages their allocation and freeing. π
when management is enabled, the kernel takes over allocation and freeing of the bounds tables. the way it does this: it traps the #BR exceptions that result at first use of missing bounds tables, and instead of delivering the exception to user space, it allocates the table and populates the bounds directory with the location of the new table. for freeing, the kernel checks to see if bounds tables are present for memory which is not allocated, and frees them if so. busy little kernel. π
β οΈ important, bestie: before enabling MPX management usingPR_MPX_ENABLE_MANAGEMENT, the application must first have allocated a user-space buffer for the bounds directory and placed the location of that directory in thebndcfguregister. skip that step and you're just asking for problems, no cap.
these calls fail if the CPU or the kernel does not support MPX. kernel support for MPX is enabled via the CONFIG_X86_INTEL_MPX configuration option. wanna check whether your CPU supports MPX? look for the mpx CPUID bit, like with the following command:
cat /proc/cpuinfo | grep ' mpx '
a thread may not switch in or out of long (64-bit) mode while MPX is enabled. so like... commit to a mode, girl. π
and heads up: all threads in a process are affected by these calls. it's a group chat thing, not a DM.
the child of a fork(2) inherits the state of MPX management. but during execve(2), MPX management is reset to a state as if PR_MPX_DISABLE_MANAGEMENT had been called. fresh start, new you, etc. β¨
πΈ RETURN VALUE πΈ
- on success,
0is returned. slay. - on error,
-1is returned, anderrnois set to indicate the error.
π ERRORS π
ENXIOβ the kernel or the CPU does not support MPX management. please check that the kernel and processor have MPX support. if they don't... it's not you, it's them. π
π STANDARDS π
None. absolutely none. she's built different and standards-compliant with nothing. π
π HISTORY π
- Linux 3.19 β she arrived. π
- Removed in Linux 5.4.
- Only on x86.
and here's the part that hurts: due to a lack of toolchain support, PR_MPX_ENABLE_MANAGEMENT and PR_MPX_DISABLE_MANAGEMENT are not supported in Linux 5.4 and later. so if you're on a modern kernel, these are giving ghost of MPX past. πͺ¦
π₯ SEE ALSO π₯
and for further information on Intel MPX, peep the kernel source file Documentation/x86/intel_mpx.rst. iykyk. π
<div align="center"> that's the whole page, bestie!! πβ¨ </div>
from Linux man-pages 6.20, dated 2026-02-08 β mwah, go read prctl(2) next, ily π«Άπ
π¦ where this page comes from
- arch rolling: man-pages 6.20-1 Β· BSD-2-Clause AND BSD-3-Clause AND BSD-4.3TAHOE AND BSD-4-Clause-UC AND GPL-1.0-or-later AND GPL-2.0-only AND GPL-2.0-or-later AND GPL-3.0-or-later AND LGPL-3.0-linking-exception AND LGPL-3.0-or-later AND LicenseRef-Public-Domain AND LicenseRef-UltraPermissive AND Linux-man-pages-1-para AND Linux-man-pages-copyleft AND Linux-man-pages-copyleft-2-para AND Linux-man-pages-copyleft-var AND MIT AND Spencer-94
- nixpkgs unstable: man-pages 6.20
- π the page's license: Linux-man-pages-copyleft
- Copyright 2014, Dave Hansen <dave.hansen@linux.intel.com>
- Copyright 2014, Intel Corp
- Copyright 2015, Michael Kerrisk <mtk.manpages@gmail.com>
- π girlified by deepseek-ai/DeepSeek-V4.1-Flash on : a language model's rewrite of the original, under its terms