[PATCH] smack: reject relabel-self writes from io_uring workers
sashiko-bot at kernel.org
sashiko-bot at kernel.org
Sat Sep 19 04:04:57 UTC 2026
> smk_write_relabel_self() calls commit_creds() on current. When the write
> is issued through io_uring it runs on an io-wq worker, and io_uring
> override_creds()es the submitter's creds when they differ from the
> worker's. commit_creds() then trips BUG_ON(task->cred != task->real_cred):
>
> kernel BUG at kernel/cred.c:376!
> commit_creds
> smk_write_relabel_self
> loop_rw_iter
> io_write
> io_wq_submit_work
> io_worker_handle_work
> io_wq_worker
>
> Even without the override, committing creds on a worker would relabel
> the worker rather than the submitting task. Refuse the write from
> PF_IO_WORKER context.
>
> Fixes: 38416e53936e ("Smack: limited capability for changing process label")
> Reported-by: syzbot+fa63184795283ac3f842 at syzkaller.appspotmail.com
> Closes: https://syzkaller.appspot.com/bug?extid=fa63184795283ac3f842
> Cc: stable at vger.kernel.org
> Signed-off-by: Nguyen Ngoc Thang <ngocthang2710.1999 at gmail.com>
Sashiko has reviewed this patch and found no issues. It looks great!
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260919035351.88453-1-ngocthang2710.1999@gmail.com?part=1
More information about the Linux-security-module-archive
mailing list