summaryrefslogtreecommitdiff
path: root/fs
diff options
context:
space:
mode:
authorThomas Gleixner <tglx@linutronix.de>2009-12-09 22:14:21 +0100
committerThomas Gleixner <tglx@linutronix.de>2010-02-21 20:20:09 +0100
commitccb8c76757e3a3d20265965ab5d94ba66be2b116 (patch)
treef7ec0675d70e0c8cf210be8d1f09001ec9b1e15f /fs
parent8f4200b312eb06ab405d2c6d0075ce4bebf738dd (diff)
downloadlwn-ccb8c76757e3a3d20265965ab5d94ba66be2b116.tar.gz
lwn-ccb8c76757e3a3d20265965ab5d94ba66be2b116.zip
proc: Add missing rcu protection for __task_cred() in task_sig()
task_sig() accesses __task_cred() without being in a RCU read side critical section. tasklist_lock is not protecting that when CONFIG_TREE_PREEMPT_RCU=y. Add a rcu_read_lock/unlock() section around the code which accesses __task_cred(). Signed-off-by: Thomas Gleixner <tglx@linutronix.de> Cc: David Howells <dhowells@redhat.com> Cc: James Morris <jmorris@namei.org> Cc: linux-security-module@vger.kernel.org Cc: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs')
-rw-r--r--fs/proc/array.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/proc/array.c b/fs/proc/array.c
index 91e2ae19584a..3dc90164e8a1 100644
--- a/fs/proc/array.c
+++ b/fs/proc/array.c
@@ -271,7 +271,9 @@ static inline void task_sig(struct seq_file *m, struct task_struct *p)
blocked = p->blocked;
collect_sigign_sigcatch(p, &ignored, &caught);
num_threads = atomic_read(&p->signal->count);
+ rcu_read_lock();
qsize = atomic_read(&__task_cred(p)->user->sigpending);
+ rcu_read_unlock();
qlim = p->signal->rlim[RLIMIT_SIGPENDING].rlim_cur;
unlock_task_sighand(p, &flags);
}