diff options
Diffstat (limited to 'fs/proc/base.c')
-rw-r--r-- | fs/proc/base.c | 16 |
1 files changed, 7 insertions, 9 deletions
diff --git a/fs/proc/base.c b/fs/proc/base.c index 58324c299165..a7310841c831 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c | |||
@@ -647,17 +647,11 @@ static int mounts_release(struct inode *inode, struct file *file) | |||
647 | static unsigned mounts_poll(struct file *file, poll_table *wait) | 647 | static unsigned mounts_poll(struct file *file, poll_table *wait) |
648 | { | 648 | { |
649 | struct proc_mounts *p = file->private_data; | 649 | struct proc_mounts *p = file->private_data; |
650 | struct mnt_namespace *ns = p->ns; | ||
651 | unsigned res = POLLIN | POLLRDNORM; | 650 | unsigned res = POLLIN | POLLRDNORM; |
652 | 651 | ||
653 | poll_wait(file, &ns->poll, wait); | 652 | poll_wait(file, &p->ns->poll, wait); |
654 | 653 | if (mnt_had_events(p)) | |
655 | spin_lock(&vfsmount_lock); | ||
656 | if (p->event != ns->event) { | ||
657 | p->event = ns->event; | ||
658 | res |= POLLERR | POLLPRI; | 654 | res |= POLLERR | POLLPRI; |
659 | } | ||
660 | spin_unlock(&vfsmount_lock); | ||
661 | 655 | ||
662 | return res; | 656 | return res; |
663 | } | 657 | } |
@@ -1095,8 +1089,12 @@ static ssize_t proc_loginuid_write(struct file * file, const char __user * buf, | |||
1095 | if (!capable(CAP_AUDIT_CONTROL)) | 1089 | if (!capable(CAP_AUDIT_CONTROL)) |
1096 | return -EPERM; | 1090 | return -EPERM; |
1097 | 1091 | ||
1098 | if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) | 1092 | rcu_read_lock(); |
1093 | if (current != pid_task(proc_pid(inode), PIDTYPE_PID)) { | ||
1094 | rcu_read_unlock(); | ||
1099 | return -EPERM; | 1095 | return -EPERM; |
1096 | } | ||
1097 | rcu_read_unlock(); | ||
1100 | 1098 | ||
1101 | if (count >= PAGE_SIZE) | 1099 | if (count >= PAGE_SIZE) |
1102 | count = PAGE_SIZE - 1; | 1100 | count = PAGE_SIZE - 1; |