Re: [yocto-patches] [pseudo] [PATCH v2 0/2] close_range: implement it rather than return ENOSYS

Mark Hatle <[email protected]> Thu, 16 Jul 2026 18:08:10 -0500
Newsgroups org.yoctoproject.lists.yocto-patches
Message-ID <[email protected]>

On 7/16/26 5:46 AM, Richard Purdie via lists.yoctoproject.org wrote:
> On Thu, 2026-07-16 at 05:56 +0000, Babanpreet Singh wrote:
>> pseudo's close_range() wrapper has returned ENOSYS unconditionally since
>> 35433e6 ("ports/linux/guts: Add close_range wrapper for glibc 2.34").
>> systemd v260 deleted its /proc/self/fd fallback and treats a failure as
>> fatal, so under pseudo every fork+exec dies. That is [YOCTO #16339]. Full
>> story in v1:
>>
>>    https://lore.kernel.org/yocto-patches/[email protected]/
> 
> I had a quick look through this and it looks ok to me, thanks!
> 
>> The v1 question about OP_CLOSEFROM stepping around five of pseudo's
>> descriptors while others exist (pseudo_prefix_dir_fd, pseudo_pwd_lck_fd,
>> pseudo_util_evlog_fd) still stands; happy to send a follow-up if that list
>> is short in both places.
> 
> I had a quick look and yes, we should really be protecting these too.
> 
> That said, I couldn't see what pseudo_prefix_dir_fd actually helps with
> and I couldn't see why we need that...

This isn't a part of the system I've touched in a very long time.  I THOUGHT it 
was the fd of the directory PSEUDO_PREFIX, so then when other files (sockets, 
etc) needed to be opened, it was all relative to the fd.  This allowed the 
directory to 'move' if necessary, since we were sure we could still access it 
via the 'fd'.  (or I'm completely wrong and remembering something different.)

The only 'definitive' reference I can find doesn't explain the why, just the 
what doc/program_flow.

I wonder if it was done to hold a file description on the directory so that if 
the PSEUDO_PATH was rm'd it wouldn't clear until pseudo itself was unloaded.

--Mark

> Cheers,
> 
> Richard
> 
> 
> -=-=-=-=-=-=-=-=-=-=-=-
> Links: You receive all messages sent to this group.
> View/Reply Online (#4494): https://lists.yoctoproject.org/g/yocto-patches/message/4494
> Mute This Topic: https://lists.yoctoproject.org/mt/120294678/3616948
> Group Owner: [email protected]
> Unsubscribe: https://lists.yoctoproject.org/g/yocto-patches/leave/13201099/3616948/947757854/xyzzy [[email protected]]
> -=-=-=-=-=-=-=-=-=-=-=-
> 
>