Re: [yocto-patches] [pseudo] [PATCH 0/3] closefrom/close_range: protect every pseudo fd, then drop one
Richard Purdie <[email protected]> Tue, 28 Jul 2026 16:59:43 +0100
| Newsgroups | org.yoctoproject.lists.yocto-patches |
|---|---|
| Message-ID | <d7ac8b50020fb439b47c512be36b674cccdc0b86.camel@linuxfoundation.org> |
On Tue, 2026-07-28 at 16:48 +0100, Richard Purdie via lists.yoctoproject.or=
g wrote:
> On Tue, 2026-07-28 at 09:14 +0100, Richard Purdie via
> lists.yoctoproject.org wrote:
> > Hi Baban,
> >=20
> > On Tue, 2026-07-28 at 05:08 +0000, Babanpreet Singh wrote:
> > > A gentle ping on this series and the close_range v2 it stacks on
> > > (which Richard okayed on-list on 16 Jul).
> > >=20
> > > I noticed pseudo master has moved since (now ca47829, with the
> > > memory-handling and openat2 changes). I've checked that both series
> > > still apply cleanly on top of current master, so no rebase is
> > > needed.
> > > Happy to rebase and resend anyway if that's more convenient.
> >=20
> > Sorry, we haven't forgotten about this, we even did discuss it
> > briefly
> > yesterday! Mark has struggled for time and I've been juggling a few
> > other issues.
> >=20
> > There were a few fixes ahead of yours in the queue, I have those
> > merged
> > as you mentioned. We then have yours and the logging fixes along with
> > some tests Mark worked on which are next.
> >=20
> > I've pushed your changes onto master-next where there were some minor
> > conflicts with other changes. I'll run some wider tests on the
> > resulting branch.
>=20
> Further testing showed the problems came back so I think I messed up
> the testing somewhere along the way, sorry :/. I'm pretty sure the
> close_range() implementation is the point things break so there must be
> some subtle issue in that code...
>=20
> I'd suggest we reorder the patches and get the skip fds and drop the
> prefix fd patches merged/queued, then come back to how to get
> close_range working. I still thing one common op codepath for both
> cases makes the most sense.
I think the missing piece is this:
diff --git a/pseudo_client.c b/pseudo_client.c
index ca37a80..a1c7052 100644
--- a/pseudo_client.c
+++ b/pseudo_client.c
@@ -1633,7 +1633,7 @@ pseudo_client_op(pseudo_op_t op, int access, int fd, =
int dirfd, const char *path
}
}
=20
- if (op !=3D OP_CHROOT && op !=3D OP_CHDIR && op !=3D OP_CLOSE && op=
!=3D OP_CLOSEFROM && op !=3D OP_DUP
+ if (op !=3D OP_CHROOT && op !=3D OP_CHDIR && op !=3D OP_CLOSE && op=
!=3D OP_CLOSEFROM && op !=3D OP_CLOSE_RANGE && op !=3D OP_DUP
&& pseudo_client_ignore_path_chroot(path, 0)) {
if (op =3D=3D OP_OPEN) {
/* Sanitise the path to have no trailing slash as t=
his is convention in the database */
Cheers,
Richard