From: Richard Purdie <richard.purdie@linuxfoundation.org>
To: Babanpreet Singh <bbnpreetsingh@gmail.com>,
yocto-patches@lists.yoctoproject.org
Cc: Paul Barker <paul@pbarker.dev>, Mark Hatle <mark.hatle@amd.com>,
Randy MacLeod <randy.macleod@windriver.com>,
Vincent Haupert <mail@vincent-haupert.de>
Subject: Re: [pseudo] [PATCH v2 1/2] ports/linux/guts: Implement close_range() instead of returning ENOSYS
Date: Tue, 28 Jul 2026 10:22:45 +0100 [thread overview]
Message-ID: <9297eef9b9ebf2871edc82fa03aa03550a622575.camel@linuxfoundation.org> (raw)
In-Reply-To: <20260716055633.7-2-bbnpreetsingh@gmail.com>
On Thu, 2026-07-16 at 05:56 +0000, Babanpreet Singh wrote:
> The close_range() wrapper added in 35433e6 ("ports/linux/guts: Add
> close_range wrapper for glibc 2.34") returns ENOSYS on the assumption
> that callers handle that. systemd v260 no longer does: it removed its
> /proc/self/fd fallback and treats a close_range() failure as fatal, so
> every fork+exec under pseudo aborts:
>
> Failed to close all file descriptors: Function not implemented
> '(mkfs)' failed with exit status 1.
>
> A client side op closes the low descriptors one at a time, skipping the
> ones pseudo needs for itself, and returns the first fd above pseudo's
> own so the caller can pass the rest of the range to the kernel directly.
>
> CLOSE_RANGE_UNSHARE is handled by calling unshare(CLONE_FILES) before
> closing anything, so the closes only affect the caller and not other
> processes sharing the descriptor table. Unknown flags and an inverted
> range are rejected with EINVAL before anything is closed.
>
> A range starting entirely above INT_MAX cannot contain any of pseudo's
> fds and is also passed straight through.
>
> [YOCTO #16339]
>
> AI-Generated: Uses Claude (claude-opus-4-8)
> Signed-off-by: Babanpreet Singh <bbnpreetsingh@gmail.com>
> ---
> enums/op.in | 1 +
> ports/linux/guts/close_range.c | 54 ++++++++++++++++++++++++++----
> ports/linux/portdefs.h | 16 +++++++++
> pseudo_client.c | 60 ++++++++++++++++++++++++++++++++++
> 4 files changed, 124 insertions(+), 7 deletions(-)
Unfortunately there is something wrong in this patch. I added this
series and your other series fixing the closed fds and with this patch
present, we see failures:
https://autobuilder.yoctoproject.org/valkyrie/#/builders/50/builds/4259
i.e. linux-libc-headers do_install fails, which is one of the first
pieces of the OE build to use pseudo. This should be reproducible in a
OE build with "bitbake linux-libc-headers -c install", with a patch
like the one below applied to update pseudo.
As soon as I revert this patch, the builds work ok. I also tested with
the second series applied without this patch (patches tweaked to apply)
and that also seems to build ok, so it would appear to be something in
this change.
I've not dug into it in detail yet but I wanted to share the issue now
I've isolated it.
Cheers,
Richard
diff --git a/meta/recipes-devtools/pseudo/pseudo_git.bb b/meta/recipes-devtools/pseudo/pseudo_git.bb
index 9f02d90568..01a66ae21e 100644
--- a/meta/recipes-devtools/pseudo/pseudo_git.bb
+++ b/meta/recipes-devtools/pseudo/pseudo_git.bb
@@ -1,6 +1,6 @@
require pseudo.inc
-SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master;protocol=https;branch=master \
+SRC_URI = "git://git.yoctoproject.org/pseudo;branch=master-next;protocol=https \
file://fallback-passwd \
file://fallback-group \
"
@@ -12,8 +12,8 @@ SRC_URI:append:class-nativesdk = " \
file://older-glibc-symbols.patch"
SRC_URI[prebuilt.sha256sum] = "ed9f456856e9d86359f169f46a70ad7be4190d6040282b84c8d97b99072485aa"
-SRCREV = "ca47829825f297d7bf83665c0541a9de4aa78009"
-PV = "1.9.8+git"
+SRCREV = "7f509ca924d27109335c4575d1fb67745c7b3abd"
+PV = "1.9.9+git"
# largefile and 64bit time_t support adds these macros via compiler flags globally
# remove them for pseudo since pseudo intercepts some of the functions which will be
next prev parent reply other threads:[~2026-07-28 9:22 UTC|newest]
Thread overview: 22+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-07-15 5:41 [pseudo] [PATCH 0/2] close_range: implement it rather than return ENOSYS Baban
2026-07-15 5:41 ` [pseudo] [PATCH 1/2] ports/linux/guts: Implement close_range() instead of returning ENOSYS Baban
2026-07-15 19:51 ` [yocto-patches] " Paul Barker
2026-07-15 5:41 ` [pseudo] [PATCH 2/2] tests: Add close_range() test Baban
2026-07-15 20:03 ` [yocto-patches] " Paul Barker
2026-07-16 5:56 ` [pseudo] [PATCH v2 0/2] close_range: implement it rather than return ENOSYS Babanpreet Singh
2026-07-16 5:56 ` [pseudo] [PATCH v2 1/2] ports/linux/guts: Implement close_range() instead of returning ENOSYS Babanpreet Singh
2026-07-28 9:22 ` Richard Purdie [this message]
[not found] ` <18C669BEC7E582E7.1643407@lists.yoctoproject.org>
2026-07-28 10:15 ` [yocto-patches] " Richard Purdie
[not found] ` <18C66CA235EABC94.3010641@lists.yoctoproject.org>
2026-07-28 10:48 ` Richard Purdie
2026-07-16 5:56 ` [pseudo] [PATCH v2 2/2] tests: Add close_range() test Babanpreet Singh
2026-07-16 10:46 ` [pseudo] [PATCH v2 0/2] close_range: implement it rather than return ENOSYS Richard Purdie
2026-07-16 15:46 ` Babanpreet Singh
2026-07-16 16:55 ` Richard Purdie
2026-07-16 23:16 ` [yocto-patches] " Mark Hatle
2026-07-16 23:08 ` Mark Hatle
2026-07-18 4:37 ` [pseudo] [PATCH 0/3] closefrom/close_range: protect every pseudo fd, then drop one Babanpreet Singh
2026-07-18 4:37 ` [pseudo] [PATCH 1/3] pseudo_client: step fully past pseudo's own fds when computing startfd Babanpreet Singh
2026-07-18 4:37 ` [pseudo] [PATCH 2/3] pseudo_client: step around all of pseudo's own fds in closefrom/close_range Babanpreet Singh
2026-07-18 4:37 ` [pseudo] [PATCH 3/3] pseudo_client: remove the unused pseudo_prefix_dir_fd Babanpreet Singh
2026-07-28 5:08 ` [pseudo] [PATCH 0/3] closefrom/close_range: protect every pseudo fd, then drop one Babanpreet Singh
2026-07-28 8:14 ` Richard Purdie
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=9297eef9b9ebf2871edc82fa03aa03550a622575.camel@linuxfoundation.org \
--to=richard.purdie@linuxfoundation.org \
--cc=bbnpreetsingh@gmail.com \
--cc=mail@vincent-haupert.de \
--cc=mark.hatle@amd.com \
--cc=paul@pbarker.dev \
--cc=randy.macleod@windriver.com \
--cc=yocto-patches@lists.yoctoproject.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.