Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5a85a8e8 authored by Linux Build Service Account's avatar Linux Build Service Account Committed by Gerrit - the friendly Code Review server
Browse files

Merge "fs/proc/array.c: make safe access to group_leader"

parents bdd6f084 213016fd
Loading
Loading
Loading
Loading
+5 −5
Original line number Diff line number Diff line
@@ -159,16 +159,16 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
	int g;
	struct fdtable *fdt = NULL;
	const struct cred *cred;
	pid_t ppid, tpid;
	pid_t ppid = 0, tpid = 0;
	struct task_struct *leader = NULL;

	rcu_read_lock();
	ppid = pid_alive(p) ?
		task_tgid_nr_ns(rcu_dereference(p->real_parent), ns) : 0;
	tpid = 0;
	if (pid_alive(p)) {
		struct task_struct *tracer = ptrace_parent(p);
		if (tracer)
			tpid = task_pid_nr_ns(tracer, ns);
		ppid = task_tgid_nr_ns(rcu_dereference(p->real_parent), ns);
		leader = p->group_leader;
	}
	cred = get_task_cred(p);
	seq_printf(m,
@@ -181,7 +181,7 @@ static inline void task_state(struct seq_file *m, struct pid_namespace *ns,
		"Gid:\t%d\t%d\t%d\t%d\n"
		"Ngid:\t%d\n",
		get_task_state(p),
		task_tgid_nr_ns(p, ns),
		leader ? task_pid_nr_ns(leader, ns) : 0,
		pid_nr_ns(pid, ns),
		ppid, tpid,
		from_kuid_munged(user_ns, cred->uid),