Skip to contentSkip to conversation

sched: add missing rcu_deref around real_parent

PATCH In review Kees Cook 1 participant 2 messages Dec 15, 2011 – Dec 16, 2011 Scheduler

lore
Share & tools
lore

Kees Cook

author
#0 lore raw

PATCH v2 1/1 sched: add missing rcu_deref around real_parent

Wrap another real_parent dereference while under rcu_read_lock.

---
v2: rebase to korg/tip/tip.git

---
 kernel/sched/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched/core.c +1 -1
index 3c5b21e..c7ea688 100644
@@ -4784,7 +4784,7 @@ void sched_show_task(struct task_struct *p)
 	free = stack_not_used(p);
 #endif
 	printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
-		task_pid_nr(p), task_pid_nr(p->real_parent),
+		task_pid_nr(p), task_pid_nr(rcu_dereference(p->real_parent)),
 		(unsigned long)task_thread_info(p)->flags);
 
 	show_stack(p, NULL);
Signature · 1 line
1.7.0.4
#1 lore raw

[tip:sched/core] sched: Add missing rcu_dereference() around -> real_parent usage

Commit-ID:  07cde2608a3b5c66515363f1b53623b1536b9785
Gitweb:     http://git.kernel.org/tip/07cde2608a3b5c66515363f1b53623b1536b9785
Author:     Kees Cook <[email protected]>
AuthorDate: Thu, 15 Dec 2011 08:49:18 -0800
Committer:  Ingo Molnar <[email protected]>
CommitDate: Fri, 16 Dec 2011 09:42:09 +0100

sched: Add missing rcu_dereference() around ->real_parent usage

Wrap another ->real_parent dereference while under rcu_read_lock.

Cc Peter Zijlstra <[email protected]>
Cc Glauber Costa <[email protected]>
Cc Suresh Siddha <[email protected]>
Cc KAMEZAWA Hiroyuki <[email protected]>
[ tidied up the changelog ]
---
 kernel/sched/core.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
kernel/sched/core.c +1 -1
index 3c5b21e..c7ea688 100644
@@ -4784,7 +4784,7 @@ void sched_show_task(struct task_struct *p)
 	free = stack_not_used(p);
 #endif
 	printk(KERN_CONT "%5lu %5d %6d 0x%08lx\n", free,
-		task_pid_nr(p), task_pid_nr(p->real_parent),
+		task_pid_nr(p), task_pid_nr(rcu_dereference(p->real_parent)),
 		(unsigned long)task_thread_info(p)->flags);
 
 	show_stack(p, NULL);