diff options
Diffstat (limited to 'fs/ioprio.c')
-rw-r--r-- | fs/ioprio.c | 14 |
1 files changed, 12 insertions, 2 deletions
diff --git a/fs/ioprio.c b/fs/ioprio.c index 748cfb92dcc6..8def14e24c37 100644 --- a/fs/ioprio.c +++ b/fs/ioprio.c | |||
@@ -139,7 +139,12 @@ SYSCALL_DEFINE3(ioprio_set, int, which, int, who, int, ioprio) | |||
139 | break; | 139 | break; |
140 | 140 | ||
141 | do_each_thread(g, p) { | 141 | do_each_thread(g, p) { |
142 | if (__task_cred(p)->uid != who) | 142 | int match; |
143 | |||
144 | rcu_read_lock(); | ||
145 | match = __task_cred(p)->uid == who; | ||
146 | rcu_read_unlock(); | ||
147 | if (!match) | ||
143 | continue; | 148 | continue; |
144 | ret = set_task_ioprio(p, ioprio); | 149 | ret = set_task_ioprio(p, ioprio); |
145 | if (ret) | 150 | if (ret) |
@@ -232,7 +237,12 @@ SYSCALL_DEFINE2(ioprio_get, int, which, int, who) | |||
232 | break; | 237 | break; |
233 | 238 | ||
234 | do_each_thread(g, p) { | 239 | do_each_thread(g, p) { |
235 | if (__task_cred(p)->uid != user->uid) | 240 | int match; |
241 | |||
242 | rcu_read_lock(); | ||
243 | match = __task_cred(p)->uid == user->uid; | ||
244 | rcu_read_unlock(); | ||
245 | if (!match) | ||
236 | continue; | 246 | continue; |
237 | tmpio = get_task_ioprio(p); | 247 | tmpio = get_task_ioprio(p); |
238 | if (tmpio < 0) | 248 | if (tmpio < 0) |