aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--include/linux/sched.h5
1 files changed, 5 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h
index b47c94e7560b..722dd313bf8a 100644
--- a/include/linux/sched.h
+++ b/include/linux/sched.h
@@ -1489,6 +1489,11 @@ static inline struct pid *task_tgid(struct task_struct *task)
1489 return task->group_leader->pids[PIDTYPE_PID].pid; 1489 return task->group_leader->pids[PIDTYPE_PID].pid;
1490} 1490}
1491 1491
1492/*
1493 * Without tasklist or rcu lock it is not safe to dereference
1494 * the result of task_pgrp/task_session even if task == current,
1495 * we can race with another thread doing sys_setsid/sys_setpgid.
1496 */
1492static inline struct pid *task_pgrp(struct task_struct *task) 1497static inline struct pid *task_pgrp(struct task_struct *task)
1493{ 1498{
1494 return task->group_leader->pids[PIDTYPE_PGID].pid; 1499 return task->group_leader->pids[PIDTYPE_PGID].pid;