[PATCH v4 0/2] landlock: fix SCOPE_SIGNAL bypass on the SIGIO/fowner path
Bryam Vargas
hexlabsecurity at proton.me
Tue Jun 2 17:27:47 UTC 2026
This series fixes a LANDLOCK_SCOPE_SIGNAL bypass on the asynchronous SIGIO
(fcntl(F_SETOWN)) delivery path, and adds a regression test.
A sandboxed process that owns a file or socket can request a signal
(F_SETSIG, e.g. SIGKILL) to be delivered to a whole process group on I/O
readiness (F_SETOWN(-pgid) + O_ASYNC). When it is the head of its own
process group -- the default after fork() -- that group still contains the
non-sandboxed process that launched it (a supervisor, a security monitor),
so the sandbox can signal processes that SCOPE_SIGNAL is meant to protect
from it.
Patch 1 narrows the same-thread-group exemption in control_current_fowner()
so a process-group fowner always records the caller's Landlock domain; the
delivery-time check in hook_file_send_sigiotask() then runs against every
group member. The direct kill() path (hook_task_kill) is unaffected.
Patch 2 adds the regression test in scoped_signal_test.c.
The defect was introduced by commit 18eb75f3af40 ("landlock: Always allow
signals between threads of the same process") in v6.15, and is present in the
stable branches that backported it (6.12.y, 6.13.y, 6.14.y).
control_current_fowner() is identical across those branches.
A/B verified on 6.12.90 + CONFIG_SECURITY_LANDLOCK (same .config, only the fix
hunk differs): without patch 1 the new test fails (the non-sandboxed parent is
signaled, SCOPE_SIGNAL bypassed); with patch 1 the new test passes and the
landlock signal-scoping suite is 20/20.
v3 -> v4 (review feedback from Mickaël Salaün):
- patch 1: rewrite the commit message -- drop the "cache" framing, lead with
the threat scenario, mostly "why" and minimal "what", "process" not "task";
- patch 1: drop PIDTYPE_SID (not possible for an fowner) and use the defensive
condition "!= PIDTYPE_PID && != PIDTYPE_TGID"; simplify the in-code comment;
- patch 1: remove Reported-by (implicit with the same Signed-off-by);
- send as a proper git send-email threaded series.
- v1/v2 were sent to security at kernel.org (embargoed; not in a public archive).
Bryam Vargas (2):
landlock: fix LANDLOCK_SCOPE_SIGNAL bypass on the SIGIO path
selftests/landlock: test SCOPE_SIGNAL on the SIGIO/fowner pgid path
security/landlock/fs.c | 9 ++
.../selftests/landlock/scoped_signal_test.c | 97 +++++++++++++++++++
2 files changed, 106 insertions(+)
base-commit: 6f3ed7fec72fc8979b2a8c7219c0a9fcfc8d07b5
--
2.43.0
More information about the Linux-security-module-archive
mailing list