mirror of
git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2025-09-18 22:14:16 +00:00
tomoyo: recognize kernel threads correctly
Commitdb68ce10c4("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 commit942cb357ae("Smack: Handle io_uring kernel thread privileges") does. Signed-off-by: Tetsuo Handa <penguin-kernel@I-love.SAKURA.ne.jp>
This commit is contained in:
parent
5797e861e4
commit
9c83465f32
1 changed files with 1 additions and 1 deletions
|
|
@ -613,7 +613,7 @@ static int tomoyo_check_unix_address(struct sockaddr *addr,
|
||||||
static bool tomoyo_kernel_service(void)
|
static bool tomoyo_kernel_service(void)
|
||||||
{
|
{
|
||||||
/* Nothing to do if I am a kernel service. */
|
/* Nothing to do if I am a kernel service. */
|
||||||
return uaccess_kernel();
|
return (current->flags & (PF_KTHREAD | PF_IO_WORKER)) == PF_KTHREAD;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
|
||||||
Loading…
Add table
Reference in a new issue