diff --git a/fs/proc/base.c b/fs/proc/base.c index 32c7f7d69267893d8a3fcd7811040241df8575d6..e43c1c9480cba9923adf3661792628c9a364f56c 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -2564,6 +2564,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) {