Re: [PATCH] futex: Prevent robust futex exit race more

From: Christian Brauner

Date: Fri Jul 24 2026 - 04:27:02 EST


On Thu, Jul 23, 2026 at 03:24:54PM +0200, Florian Weimer wrote:
> * Christian Brauner:
>
> > Fwiw, I added unique inode numbers for the lifetime of the system to
> > pidfds some time ago. The inode number is allocated for every struct pid
> > and available via pid->ino. A pidfd can be stat()ed to retrieve it. Just
> > mentioning it in case this may be useful.
>
> Is there an efficient way to get this without allocating a file
> descriptor, and without /proc being mounted?

No. You need to allocate a pidfd to get access to them. I have never
considered upgrading them to a generic propery. They are tied to pidfds
by design and to inodes. And I think introducing that number as an
orthogonal concept would risk implicily upgrading it to the system call
layer. Which seems less than ideal... Fwiw, pidfds also support file
handles where the inode number is encoded into the handle.