aboutsummaryrefslogtreecommitdiffstats
path: root/fs/proc/base.c
diff options
context:
space:
mode:
authorJens Axboe <axboe@kernel.dk>2020-10-15 13:46:44 -0600
committerJens Axboe <axboe@kernel.dk>2020-10-17 09:25:47 -0600
commit4ea33a976bfe79293965d0815e1914e4b6e58967 (patch)
treee041b64e9f8841fdbaf28120171f32c64f42247b /fs/proc/base.c
parentio_uring: use percpu counters to track inflight requests (diff)
downloadlinux-dev-4ea33a976bfe79293965d0815e1914e4b6e58967.tar.xz
linux-dev-4ea33a976bfe79293965d0815e1914e4b6e58967.zip
io-wq: inherit audit loginuid and sessionid
Make sure the async io-wq workers inherit the loginuid and sessionid from the original task, and restore them to unset once we're done with the async work item. While at it, disable the ability for kernel threads to write to their own loginuid. Signed-off-by: Jens Axboe <axboe@kernel.dk>
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r--fs/proc/base.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c
index aa69c35d904c..0f707003dda5 100644
--- a/fs/proc/base.c
+++ b/fs/proc/base.c
@@ -1268,6 +1268,10 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf,
kuid_t kloginuid;
int rv;
+ /* Don't let kthreads write their own loginuid */
+ if (current->flags & PF_KTHREAD)
+ return -EPERM;
+
rcu_read_lock();
if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) {
rcu_read_unlock();