projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
5a2d419
)
kernel/sys.c: fix missing rcu protection for sys_getpriority()
author
Tetsuo Handa
<
[email protected]
>
Mon, 22 Feb 2010 20:44:16 +0000
(12:44 -0800)
committer
Linus Torvalds
<
[email protected]
>
Tue, 23 Feb 2010 03:50:34 +0000
(19:50 -0800)
find_task_by_vpid() is not safe without rcu_read_lock(). 2.6.33-rc7 got
RCU protection for sys_setpriority() but missed it for sys_getpriority().
Signed-off-by: Tetsuo Handa <
[email protected]
>
Cc: Oleg Nesterov <
[email protected]
>
Cc: "Paul E. McKenney" <
[email protected]
>
Acked-by: Serge Hallyn <
[email protected]
>
Acked-by: Thomas Gleixner <
[email protected]
>
Signed-off-by: Andrew Morton <
[email protected]
>
Signed-off-by: Linus Torvalds <
[email protected]
>
kernel/sys.c
patch
|
blob
|
history
diff --git
a/kernel/sys.c
b/kernel/sys.c
index 26a6b73a6b85bbc2a4ee1e1392d3aa86d1e9a850..18bde979f346c46a8af621b62171912a1db98f5a 100644
(file)
--- a/
kernel/sys.c
+++ b/
kernel/sys.c
@@
-222,6
+222,7
@@
SYSCALL_DEFINE2(getpriority, int, which, int, who)
if (which > PRIO_USER || which < PRIO_PROCESS)
return -EINVAL;
+ rcu_read_lock();
read_lock(&tasklist_lock);
switch (which) {
case PRIO_PROCESS:
@@
-267,6
+268,7
@@
SYSCALL_DEFINE2(getpriority, int, which, int, who)
}
out_unlock:
read_unlock(&tasklist_lock);
+ rcu_read_unlock();
return retval;
}