summaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python
diff options
context:
space:
mode:
authorMickaël Salaün <mic@digikod.net>2026-11-18 15:52:06 +0100
committerMickaël Salaün <mic@digikod.net>2026-11-19 11:55:28 +0100
commit25590e68c40753e28e4713d2dbfde6ba10a7daeb (patch)
tree334052b9804525f9a899cbd5b324c95bbd5a71fb /tools/perf/scripts/python
parent591bdbafeead9ae8458687cd873e277e6a87949a (diff)
landlock: Mediate CAP_SYS_RAWIO for mappings below mmap_min_addr
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@google.com> Cc: Paul Moore <paul@paul-moore.com> Cc: Serge Hallyn <serge@hallyn.com> Acked-by: Serge Hallyn (AMD) <sergeh@kernel.org> Reviewed-by: Günther Noack <gnoack@google.com> Fixes: 97c8386f1d74 ("landlock: Enforce capability restrictions") Link: https://patch.msgid.link/20261118145217.2551053-3-mic@digikod.net Signed-off-by: Mickaël Salaün <mic@digikod.net>
Diffstat (limited to 'tools/perf/scripts/python')
0 files changed, 0 insertions, 0 deletions