|
@@ -1489,6 +1489,11 @@ static inline struct pid *task_tgid(struct task_struct *task)
|
|
return task->group_leader->pids[PIDTYPE_PID].pid;
|
|
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)
|
|
static inline struct pid *task_pgrp(struct task_struct *task)
|
|
{
|
|
{
|
|
return task->group_leader->pids[PIDTYPE_PGID].pid;
|
|
return task->group_leader->pids[PIDTYPE_PGID].pid;
|