CAP_IPC_LOCK
Lock memory with mlock, mlockall, MAP_LOCKED and SHM_LOCK; exceed RLIMIT_MEMLOCK.
- Bit number
- 14
- Mask in /proc/PID/status
- 0000000000004000
- Added in Linux
- Original 2.2 set
- Group
- Memory locking and IPC
Lets a process pin pages so they never reach swap, which is what you want for key material. Without it you are bound by RLIMIT_MEMLOCK. Raising that limit for the service in its unit file is usually the narrower fix.
Narrower option: Raise RLIMIT_MEMLOCK for the one service instead of granting the capability.
Check a running process with grep Cap /proc/PID/status, or paste the hex into the mask decoder.
Syscall cards that mention it
- memfd_create(2)Linux · Memory
Create an anonymous RAM-backed file with no path, optionally sealable.
- mlock(2)Linux · Memory
Lock pages into RAM so they can't be swapped out; mlockall() does the whole address space.
Rod on this
Sources
Bit numbers are from linux/capability.h. The list of syscall cards is matched by name from the card text on this site, not from the kernel source. Spot one that's wrong? Tell Rod.