RFC Landlock signal scope and TIOCSIG
Get series with b4
b4 am [email protected]Versions newest first
- v1 RFC Latest2 patches 5 repliesIn review
Patches in v1 No applies recorded yet
| # | Subject and files | Size | Replies | Applied |
|---|---|---|---|---|
| 1/2 | tty: mediate TIOCSIG through task_kill LSM hooksdrivers/ include/ kernel/ | +35 | 1 reply | |
| 2/2 | selftests/landlock: cover TIOCSIG signal scopingtools/ | +142 | 0 replies |
Reviews trailers per patch
No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.
Cover letter [RFC PATCH 0/2] Landlock signal scope and TIOCSIG
Landlock documents LANDLOCK_SCOPE_SIGNAL as limiting signal delivery to processes in the same or a nested Landlock domain. A retained PTY master can currently use TIOCSIG to deliver SIGINT, SIGQUIT, or SIGTSTP to an out-of-domain slave foreground process group because the privileged TTY signal path never reaches security_task_kill().
This RFC asks two questions before proposing a final interface.
First, should this be classified as SCOPE_SIGNAL under-enforcement, or as part of Landlock's documented inherited-TTY limitation? The "Current limitations / IOCTL support" section says that IOCTL_DEV does not affect pre-existing descriptors, names TIOCSTI and TIOCLINUX, and recommends closing inherited TTY descriptors. That text discusses the filesystem IOCTL_DEV right rather than SCOPE_SIGNAL, and unlike the two named ioctls, TIOCSIG is not CAP_SYS_ADMIN-gated. Commit 4b80320ca7ed fixed the same effect-level class for SIGIO rather than treating the retained signal source as exempt.
Second, if this is a bug, should TIOCSIG use the existing task_kill hook as patch 1 demonstrates, or should it gain a dedicated TTY-signal hook which Landlock can implement without changing other LSM policies? The prototype is atomic with process-group delivery and behaviorally narrow to TIOCSIG, but calling task_kill means SELinux, Smack, AppArmor, BPF LSM programs, and future implementations also mediate this operation. The series does not claim that cross-LSM policy change is settled.
The demonstrated generic impact is low:
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:C/C:N/I:N/A:L = 3.8. Scope is changed because the effect reaches a process outside the sandbox authority, but the primitive is limited to three job-control signals and no independent integrity impact has been reproduced.
Patch 1 is the behaviorally validated proof-of-concept fix. Patch 2 is a minimal regression test; further test polishing should follow the chosen interface direction.
Validation used the same userspace image against the affected and patched kernels. Across three boots per image and 32 iterations per cell:
affected: 96/96 cross-domain TIOCSIG deliveries
patched: 96/96 cross-domain TIOCSIG denials
both: 96/96 unconfined deliveries
96/96 same-domain deliveries
96/96 scoped direct-kill denials
The regression test separately fails on the affected image and passes on the patched image, with exactly one TAP test executed in each run.
No external report or patch has been sent before this RFC. Guidance on both classification and hook direction would be appreciated.
Christopher Lusk (2):
tty: mediate TIOCSIG through task_kill LSM hooks selftests/landlock: cover TIOCSIG signal scoping
drivers/tty/pty.c | 8 +- include/linux/sched/signal.h | 1 + kernel/signal.c | 30 +++- .../selftests/landlock/scoped_signal_test.c | 142 ++++++++++++++++++ 4 files changed, 177 insertions(+), 4 deletions(-)
Signature · 1 line
2.55.0