lists.openwall.net   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  linux-cve-announce  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]
Message-ID: <20070817144813.GA347@tv-sign.ru>
Date:	Fri, 17 Aug 2007 18:48:13 +0400
From:	Oleg Nesterov <oleg@...sign.ru>
To:	Pavel Emelyanov <xemul@...nvz.org>
Cc:	Andrew Morton <akpm@...l.org>,
	Linux Kernel Mailing List <linux-kernel@...r.kernel.org>,
	Sukadev Bhattiprolu <sukadev@...ibm.com>, devel@...nvz.org
Subject: Re: [PATCH] Isolate some explicit usage of task->tgid

On 08/17, Pavel Emelyanov wrote:
>
> Actually the p->tgid == pid has to be changed to has_group_leader_pid(), 
> but Oleg pointed out that this is the same and thread_group_leader() 
> is more preferable. 

No, no, sorry for confusion! I was not clear. I meant that thread_group_leader()
is imho better for posix timers, but

> @@ -865,8 +865,8 @@ static int de_thread(struct task_struct 
> 
> 		write_lock_irq(&tasklist_lock);
> 
> -		BUG_ON(leader->tgid != tsk->tgid);
> -		BUG_ON(tsk->pid == tsk->tgid);
> +		BUG_ON(!same_thread_group(leader, tsk));
> +		BUG_ON(thread_group_leader(tsk));

This should be has_group_leader_pid(), BUG_ON() really checks that
we didn't confuse ->tgid's.

> 		/*
> 		 * An exec() starts a new thread group with the
> 		 * TGID of the previous thread group. Rehash the
> diff --git a/fs/proc/base.c b/fs/proc/base.c
> index e3009ab..31e7dfe 100644
> --- a/fs/proc/base.c
> +++ b/fs/proc/base.c
> @@ -2288,7 +2288,7 @@ retry:
> 		 * found doesn't happen to be a thread group leader.
> 		 * As we don't care in the case of readdir.
> 		 */
> -		if (!task || !has_group_leader_pid(task))
> +		if (!task || !thread_group_leader(task))

And this _must_ be has_group_leader_pid(), this was actually the reason
to introduce the "has_group_leader_pid()" helper.

Otherwise I think the patch is fine, and the new helper is really useful.

Oleg.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
Please read the FAQ at  http://www.tux.org/lkml/

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ