From b4ad27a33d0e3b1f795ffa43d9b7dfd7ea26ee28 Mon Sep 17 00:00:00 2001 From: Oleg Nesterov Date: Thu, 2 Apr 2009 16:58:35 -0700 Subject: [PATCH] --- yaml --- r: 139708 b: refs/heads/master c: 6dda81f4384b94930826eded254d8c16f89a9248 h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/linux/sched.h | 5 +++++ 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/[refs] b/[refs] index e5966f54b842..2fe0392e6e60 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: 8e654fba4a376f436bdfe361fc5cdbc87ac09b35 +refs/heads/master: 6dda81f4384b94930826eded254d8c16f89a9248 diff --git a/trunk/include/linux/sched.h b/trunk/include/linux/sched.h index b47c94e7560b..722dd313bf8a 100644 --- a/trunk/include/linux/sched.h +++ b/trunk/include/linux/sched.h @@ -1489,6 +1489,11 @@ static inline struct pid *task_tgid(struct task_struct *task) return task->group_leader->pids[PIDTYPE_PID].pid; } +/* + * Without tasklist or rcu lock it is not safe to dereference + * the result of task_pgrp/task_session even if task == current, + * we can race with another thread doing sys_setsid/sys_setpgid. + */ static inline struct pid *task_pgrp(struct task_struct *task) { return task->group_leader->pids[PIDTYPE_PGID].pid;