diff --git a/fs/proc/base.c b/fs/proc/base.c index 5e0406eb975ed1a8cc85423281e017e1cfacc19b..720e2e524cb1324261d2ea8b7d1fc5250e4ab2f4 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2720,6 +2720,10 @@ static ssize_t proc_pid_attr_write(struct file * file, const char __user * buf, void *page; int rv; + /* A task may only write when it was the opener. */ + if (file->f_cred != current_real_cred()) + return -EPERM; + rcu_read_lock(); task = pid_task(proc_pid(inode), PIDTYPE_PID); if (!task) {