[RFC PATCH 1/2] apparmor: mediate file-generated signals

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sat Nov 7 16:00:17 UTC 2026


> File-generated SIGIO and SIGURG notifications use file_send_sigiotask
> rather than task_kill. AppArmor does not implement that hook, so its
> signal send and receive rules are not enforced on this path. A profile
> that denies SIGIO reception can therefore still receive an asynchronous
> pipe notification even though a direct kill() is denied.
> 
> Save the credentials of the task that sets the file owner and use them
> as the sender identity at delivery. Resolve the newest sender and
> recipient labels, and use aa_may_signal() to enforce both send and
> receive rules. Treat a zero signal argument as SIGIO.
> 
> Use the existing fown lock to protect the saved credentials. Replace
> the reference when ownership is set again and drop it when the file is
> destroyed. The task triggering I/O need not be the owner setter, and
> delivery can run in interrupt context, so current cannot identify the
> sender.
> 
> QEMU/KVM tests on v7.4-rc1 cover send/receive denials, allowed signals,
> F_SETSIG, process-group and TID owners, profile transitions, ownership
> replacement, unconfined senders and TCP urgent notifications. A separate
> fcntl fix handles the case where queuing a configured signal fails and
> delivery falls back to an unchecked SIGIO.
> 
> Fixes: cd1dbf76b23d ("apparmor: add the ability to mediate signals")
> Signed-off-by: Shi Lecun <shilc2025 at mail.sustech.edu.cn>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/B01DC8398B429509+20261107154928.3519030-2-shilc2025@mail.sustech.edu.cn?part=1




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