From 3acf12ff5e7f41d63064fe8de98f9aea11f28f5d Mon Sep 17 00:00:00 2001 From: Daniel J Blueman Date: Tue, 9 Nov 2010 21:33:02 +0100 Subject: [PATCH] --- yaml --- r: 221828 b: refs/heads/master c: 1447399b3e34af016c368b4178db7ef0e04e15b0 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/fs/ioprio.c | 14 ++++++++++++-- 2 files changed, 13 insertions(+), 3 deletions(-) diff --git a/[refs] b/[refs] index bc9306bda1a8..3a14a0b0c314 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: a014741c0adfb8fb79952939ca087cf03d272bb9 +refs/heads/master: 1447399b3e34af016c368b4178db7ef0e04e15b0 diff --git a/trunk/fs/ioprio.c b/trunk/fs/ioprio.c index 748cfb92dcc6..8def14e24c37 100644 --- a/trunk/fs/ioprio.c +++ b/trunk/fs/ioprio.c @@ -139,7 +139,12 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) break; do_each_thread(g, p) { - if (__task_cred(p)->uid != who) + int match; + + rcu_read_lock(); + match = __task_cred(p)->uid == who; + rcu_read_unlock(); + if (!match) continue; ret = set_task_ioprio(p, ioprio); if (ret) @@ -232,7 +237,12 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) break; do_each_thread(g, p) { - if (__task_cred(p)->uid != user->uid) + int match; + + rcu_read_lock(); + match = __task_cred(p)->uid == user->uid; + rcu_read_unlock(); + if (!match) continue; tmpio = get_task_ioprio(p); if (tmpio < 0)