Commit a176cc52 authored by Tetsuo Handa's avatar Tetsuo Handa Committed by Zheng Zengkai
Browse files

tomoyo: recognize kernel threads correctly



stable inclusion
from stable-5.10.22
commit aa40f5e33ce337a037ec06cc11aae49be64c306c
bugzilla: 50796

--------------------------------

commit 9c83465f upstream.

Commit db68ce10 ("new helper: uaccess_kernel()") replaced
segment_eq(get_fs(), KERNEL_DS) with uaccess_kernel(). But the correct
method for tomoyo to check whether current is a kernel thread in order
to assume that kernel threads are privileged for socket operations was
(current->flags & PF_KTHREAD). Now that uaccess_kernel() became 0 on x86,
tomoyo has to fix this problem. Do like commit 942cb357 ("Smack:
Handle io_uring kernel thread privileges") does.

Signed-off-by: default avatarTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarChen Jun <chenjun102@huawei.com>
Acked-by: default avatar  Weilong Chen <chenweilong@huawei.com>
Signed-off-by: default avatarZheng Zengkai <zhengzengkai@huawei.com>
parent 866217e4
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment