lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  PHC 
Open Source and information security mailing list archives
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 23 Jan 2017 13:52:23 +0100
From:   Oleg Nesterov <>
To:     Pavel Tikhomirov <>,
        Kees Cook <>
Cc:     Ingo Molnar <>,
        Peter Zijlstra <>,
        Andrew Morton <>,
        Cyrill Gorcunov <>,
        John Stultz <>,
        Thomas Gleixner <>,
        Nicolas Pitre <>,
        Michal Hocko <>,
        Stanislav Kinsburskiy <>,
        Mateusz Guzik <>,,
        Pavel Emelyanov <>,
        Konstantin Khorenko <>
Subject: task_is_descendant() cleanup

On 01/23, Oleg Nesterov wrote:
> Btw task_is_descendant() looks wrong at first glance.

No, I missed the 2nd ->group_leader dereference. Still this function looks
overcomplicated and the usage of thread_group_leader/group_leader just add
the unnecessary confusion. It can be simplified a little bit:

	static int task_is_descendant(struct task_struct *parent,
				      struct task_struct *child)
		int rc = 0;
		struct task_struct *walker;

		if (!parent || !child)
			return 0;

		for (walker = child; walker->pid; walker = rcu_dereference(walker->real_parent))
			if (same_thread_group(parent, walker)) {
				rc = 1;

		return rc;

Kees, I can send a patch if you think this very minor cleanup makes any sense.


Powered by blists - more mailing lists