[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20220401070942.odjbuc5wecfayyok@wittgenstein>
Date: Fri, 1 Apr 2022 09:09:42 +0200
From: Christian Brauner <brauner@...nel.org>
To: Alois Wohlschlager <alois1@...-topmail.de>
Cc: "Eric W. Biederman" <ebiederm@...ssion.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Peter Zijlstra <peterz@...radead.org>,
Alexey Gladkov <legion@...nel.org>,
Jens Axboe <axboe@...nel.dk>,
David Hildenbrand <david@...hat.com>,
Rolf Eike Beer <eb@...ix.com>,
Ran Xiaokai <ran.xiaokai@....com.cn>,
Matthew Bobrowski <repnop@...gle.com>, Jan Kara <jack@...e.cz>,
linux-kernel@...r.kernel.org
Subject: Re: [PATCH] pid: Allow creation of pidfds to threads
On Thu, Mar 31, 2022 at 09:02:32PM +0200, Alois Wohlschlager wrote:
> The pidfd_open() syscall now allows retrieving pidfds to processes which
> are not thread group leaders. Like standard pidfds so far, these may be
> used to retrieve file descriptors from the target thread using
> pidfd_getfd(), as well as for killing the target thread group using
> pidfd_send_signal().
> However, unlike pidfds referencing thread group leaders, they do not
> support polling for process exit. Attempts to do so signal an error
> condition instead of blocking indefinitely.
>
> Since the semantics of pidfd_getfd() and pidfd_send_signal() are not
> very useful within a thread group, these thread pidfds can only be
> created using pidfd_open(), not via clone().
>
> Signed-off-by: Alois Wohlschlager <alois1@...-topmail.de>
> ---
Hey Alois,
We originally blocked this because it is not as easy as simply allowing
pidfds to be created for non-thread-group leaders.
For a start, pidfd_poll() currently doens't work if pidfd_task() isn't a
thread-group leader and you'll just hang for CLONE_PIDFD | CLONE_THREAD.
So at least that needs to be adapated as well and there's likely a bunch
of other corner-cases I'm forgetting about.
Do you have a concrete use-case you want this for?
Christian
Powered by blists - more mailing lists