]> git.baikalelectronics.ru Git - kernel.git/commit
tomoyo: recognize kernel threads correctly
authorTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 1 Feb 2021 02:53:05 +0000 (11:53 +0900)
committerTetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
Mon, 1 Feb 2021 02:53:05 +0000 (11:53 +0900)
commit882dbea3a22ad13da37f4d7279f096cc664f8786
tree2eeddbaf52a3a3e3233ffec28e8deecddd0c8195
parentf5c15d9d50b229bd30b19ec24b090e86b44b198a
tomoyo: recognize kernel threads correctly

Commit 29a69a073f00f61f ("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 34ce4b51842c4ac2 ("Smack:
Handle io_uring kernel thread privileges") does.

Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
security/tomoyo/network.c