diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 746895ddfda..a7310841c83 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -1089,8 +1089,12 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, if (!capable(CAP_AUDIT_CONTROL)) return -EPERM; - if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) + rcu_read_lock(); + if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) { + rcu_read_unlock(); return -EPERM; + } + rcu_read_unlock(); if (count >= PAGE_SIZE) count = PAGE_SIZE - 1; |