[PATCH v3 4/6] landlock: Mediate CAP_SYS_ADMIN for the admin memory reserve

sashiko-bot at kernel.org sashiko-bot at kernel.org
Wed Nov 18 14:56:52 UTC 2026


> With vm.overcommit_memory=2, __vm_enough_memory() keeps the admin
> reserve for callers with CAP_SYS_ADMIN, which cap_vm_enough_memory()
> checks with cap_capable(), so a domain denying CAP_SYS_ADMIN cannot
> withhold this reserve, meant for an administrator to recover from memory
> exhaustion.
> 
> Add a Landlock vm_enough_memory hook that withholds the reserve when the
> domain denies CAP_SYS_ADMIN.  Like commoncap and SELinux, do not audit
> this check: it runs for every accounted mapping and only selects a
> limit.
> 
> Cc: Günther Noack <gnoack at google.com>
> Cc: Paul Moore <paul at paul-moore.com>
> Cc: Serge Hallyn <serge at hallyn.com>
> Acked-by: Serge Hallyn (AMD) <sergeh at kernel.org>
> Reviewed-by: Günther Noack <gnoack at google.com>
> Fixes: 97c8386f1d74 ("landlock: Enforce capability restrictions")
> Signed-off-by: Mickaël Salaün <mic at digikod.net>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261118145217.2551053-1-mic@digikod.net?part=4




More information about the Linux-security-module-archive mailing list