[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <2025-09-24-grubby-secure-felon-sabotage-7t35lM@cyphar.com>
Date: Wed, 24 Sep 2025 21:11:13 +1000
From: Aleksa Sarai <cyphar@...har.com>
To: Askar Safin <safinaskar@...il.com>
Cc: alx@...nel.org, brauner@...nel.org, dhowells@...hat.com,
g.branden.robinson@...il.com, jack@...e.cz, linux-api@...r.kernel.org,
linux-fsdevel@...r.kernel.org, linux-kernel@...r.kernel.org, linux-man@...r.kernel.org,
mtk.manpages@...il.com, safinaskar@...omail.com, viro@...iv.linux.org.uk
Subject: Re: [PATCH v4 00/10] man2: document "new" mount API
On 2025-09-21, Aleksa Sarai <cyphar@...har.com> wrote:
> On 2025-09-21, Askar Safin <safinaskar@...il.com> wrote:
> > * open_tree(2) still says:
> > > If flags does not contain OPEN_TREE_CLONE, open_tree() returns a file descriptor
> > > that is exactly equivalent to one produced by openat(2) when called with the same dirfd and path.
> >
> > This is not true if automounts are involved. I suggest adding "modulo automounts". But you may
> > keep everything, of course.
>
> Hmmm. As we discussed last time, this sentence is more intended to
> indicate that the file descriptor is just a regular open file (with no
> dissolve_on_fput() + FMODE_NEED_UNMOUNT magic) rather than the exact
> behaviour you get with regards to path lookup.
>
> I would honestly prefer to remove "when called with the same dirfd and
> path" rather than add caveats, but I think it makes the sentence less
> readable... I'll think about it and try to fix this wording up somehow
> for v5.
I've gone with the following:
In either case, the resultant file descriptor
acts the same as one produced by
.BR open (2)
with
.BR O_PATH ,
meaning it can also be used as a
.I dirfd
argument to
"*at()" system calls.
+However,
+unlike
+.BR open (2)
+called with
+.BR O_PATH ,
+automounts will
+by default
+be triggered by
+.BR open_tree ()
+unless
+.B \%AT_NO_AUTOMOUNT
+is included in
+.IR flags .
After looking at it a few times, I decided adding it to the proceeding
paragraph (as you suggested) didn't really make sense since the O_PATH
equivalence is only mentioned in this following paragraph.
Also, the automount behaviour also applies to OPEN_TREE_CLONE, so it's
best to not mislead a reader into thinking it only applies to one of the
cases.
--
Aleksa Sarai
Senior Software Engineer (Containers)
SUSE Linux GmbH
https://www.cyphar.com/
Download attachment "signature.asc" of type "application/pgp-signature" (266 bytes)
Powered by blists - more mailing lists