[PATCH v3 2/6] landlock: Mediate CAP_SYS_RAWIO for mappings below mmap_min_addr
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Wed Nov 18 14:57:35 UTC 2026
> commoncap's mmap_addr hook checks CAP_SYS_RAWIO for mappings below
> vm.mmap_min_addr with cap_capable(), which skips the capable hook, so a
> domain denying CAP_SYS_RAWIO cannot prevent these mappings. Mapping the
> lowest pages helps to exploit kernel NULL pointer dereferences.
>
> Add a Landlock mmap_addr hook that checks CAP_SYS_RAWIO against the
> domain under the same condition, as SELinux checks its own mmap_zero
> permission in this hook. commoncap runs first, so the hook only sees
> mappings that commoncap allowed. This also covers the x86 vm86(2) and
> vm86old(2) system calls. Calling capable() from cap_mmap_addr() would
> instead expose this check to the capable hook of all LSMs.
>
> 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=2
More information about the Linux-security-module-archive
mailing list