[PATCH 04/13] fcntl: use cred_ids_allow_sigio()

sashiko-bot at kernel.org sashiko-bot at kernel.org
Sun Oct 18 17:37:40 UTC 2026


> sigio_perm() has the four comparisons of kill_ok_by_cred(), and lets euid
> 0 signal anybody. Use the library.
> 
> The library compares credentials. F_SETOWN only copies the uid and the
> euid of the caller into struct fown_struct, so keep a reference on its
> credentials instead, as struct file does for whoever opened it. That makes
> the sender of a SIGIO a credential like the sender of any other signal.
> 
> F_GETOWNER_UIDS goes on reporting uid 0 for a file whose owner was never
> set.
> 
> The credentials now stay around until the owner is set again or the file
> is released. Clearing the owner leaves them alone, as it left the two ids
> alone, so that F_GETOWNER_UIDS goes on reporting them. Who may be
> signalled does not change.
> 
> Assisted-by: LLM
> Signed-off-by: Josef Bacik <josef at toxicpanda.com>

Sashiko has reviewed this patch and found no issues.

-- 
Sashiko AI review · https://sashiko.dev/#/patchset/20261018-b4-cred-ids-v1-0-7bdf2db4ea9f@toxicpanda.com?part=4




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