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]
Date: Tue, 30 Jan 2024 19:27:50 -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
Subject: Re: [PATCH v2] pidfd: implement PIDFD_THREAD flag for pidfd_open()

On Tue, Jan 30, 2024 at 12:34:09PM +0100, Oleg Nesterov wrote:
> Damn. Self-NACK.
> 
> I forgot (we all ;) about mt-exec, and there are 2 problems.
> 
> 1. The "if (!thread_group_leader(tsk))" block in de_thread() needs
>    do_notify_pidfd() too, the execing non-leader thread looses its
>    old pid, pidfd_poll(PIDFD_THREAD, pid-of-execing-sub-thread)
>    should succeed. Must be fixed, I think.

I think the `test_non_tgl_exec` from my tests exercises the scenario
you're describing, and it works.

> 2. pidfd_poll(PIDFD_THREAD, pid-of-group-leader) should not succeed
>    when its sub-thread execs, the execing thread inherits the leader's
>    pid. Perhaps pidfd_task_exited() can check sig->group_exec_task,

I didn't have an explicit test for this, but I hacked one up, and
pidfd_poll(PIDFD_THREAD, pid-of-group-leader) doesn't return after
exec.

I think it's ok? But I must be missing something.

Tycho

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ