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: <ZWjM6trZ6uw6yBza@tycho.pizza>
Date:   Thu, 30 Nov 2023 10:56:58 -0700
From:   Tycho Andersen <tycho@...ho.pizza>
To:     Oleg Nesterov <oleg@...hat.com>
Cc:     Christian Brauner <brauner@...nel.org>,
        "Eric W . Biederman" <ebiederm@...ssion.com>,
        linux-kernel@...r.kernel.org, linux-api@...r.kernel.org,
        Tycho Andersen <tandersen@...flix.com>
Subject: Re: [RFC 1/3] pidfd: allow pidfd_open() on non-thread-group leaders

On Thu, Nov 30, 2023 at 06:39:39PM +0100, Oleg Nesterov wrote:
> Hi Tycho,
> 
> I can't really read this patch now, possibly I am wrong, but...

No worries, no rush here.

> On 11/30, Tycho Andersen wrote:
> >
> > @@ -263,16 +263,25 @@ void release_task(struct task_struct *p)
> >  	 */
> >  	zap_leader = 0;
> >  	leader = p->group_leader;
> > -	if (leader != p && thread_group_empty(leader)
> > -			&& leader->exit_state == EXIT_ZOMBIE) {
> > -		/*
> > -		 * If we were the last child thread and the leader has
> > -		 * exited already, and the leader's parent ignores SIGCHLD,
> > -		 * then we are the one who should release the leader.
> > -		 */
> > -		zap_leader = do_notify_parent(leader, leader->exit_signal);
> > -		if (zap_leader)
> > -			leader->exit_state = EXIT_DEAD;
> > +	if (leader != p) {
> > +		if (thread_group_empty(leader)
> > +				&& leader->exit_state == EXIT_ZOMBIE) {
> > +			/*
> > +			 * If we were the last child thread and the leader has
> > +			 * exited already, and the leader's parent ignores SIGCHLD,
> > +			 * then we are the one who should release the leader.
> > +			 */
> > +			zap_leader = do_notify_parent(leader,
> > +						      leader->exit_signal);
> > +			if (zap_leader)
> > +				leader->exit_state = EXIT_DEAD;
> > +		} else {
> > +			/*
> > +			 * wake up pidfd pollers anyway, they want to know this
> > +			 * thread is dying.
> > +			 */
> > +			wake_up_all(&thread_pid->wait_pidfd);
>                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
> 
> somehow I can't believe this is a good change after a quick glance ;)

Yeah, I figured it would raise some eyebrows :)

> I think that wake_up_all(wait_pidfd) should have a single caller,
> do_notify_pidfd(). This probably means it should be shiftef from
> do_notify_parent() to exit_notify(), I am not sure...

__exit_signals() is what I was thinking in the patch description, but
I'll look at exit_notify() too.

Tycho

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ