From: Christian Brauner <brauner@kernel.org>
To: Aleksa Sarai <cyphar@cyphar.com>
Cc: Askar Safin <safinaskar@zohomail.com>,
alx@kernel.org, dhowells@redhat.com,
g.branden.robinson@gmail.com, jack@suse.cz,
linux-api@vger.kernel.org, linux-fsdevel@vger.kernel.org,
linux-kernel@vger.kernel.org, linux-man@vger.kernel.org,
mtk.manpages@gmail.com, viro@zeniv.linux.org.uk,
Ian Kent <raven@themaw.net>,
autofs mailing list <autofs@vger.kernel.org>
Subject: Re: [PATCH v3 00/12] man2: document "new" mount API
Date: Tue, 19 Aug 2025 10:31:35 +0200 [thread overview]
Message-ID: <20250819-erhitzen-knacken-e4d52248ca3e@brauner> (raw)
In-Reply-To: <2025-08-17.1755446479-rotten-curled-charms-robe-vWOBH5@cyphar.com>
On Mon, Aug 18, 2025 at 02:16:04AM +1000, Aleksa Sarai wrote:
> On 2025-08-17, Askar Safin <safinaskar@zohomail.com> wrote:
> > I noticed that you changed docs for automounts. So I dig into
> > automounts implementation. And I found a bug in openat2. If
> > RESOLVE_NO_XDEV is specified, then name resolution doesn't cross
> > automount points (i. e. we get EXDEV), but automounts still happen! I
> > think this is a bug. Bug is reproduced in 6.17-rc1. In the end of this
> > mail you will find reproducer. And miniconfig.
>
> Yes, this is a bug -- we check LOOKUP_NO_XDEV after traverse_mounts()
> because we want to error out if we actually jumped to a different mount.
> We should probably be erroring out in follow_automount() as well, and I
> missed this when I wrote openat2().
>
> openat2() also really needs RESOLVE_NO_AUTOMOUNT (and probably
> RESOLVE_NO_DOTDOT as well as some other small features). I'll try to
> send something soon.
>
> > Are automounts actually used? Is it possible to deprecate or
> > remove them? It seems for me automounts are rarely tested obscure
> > feature, which affects core namei code.
>
> I use them for auto-mounting NFS shares on my laptop, and I'm sure there
> are plenty of other users. They are little bit funky but I highly doubt
> they are "unused". Howells probably disagrees in even stronger terms.
> Most distributions provide autofs as a supported package (I think it
> even comes pre-installed for some distros).
>
> They are not tested by fstests AFAICS, but that's more of a flaw in
> fstests (automount requires you to have a running autofs daemon, which
> probably makes testing it in fstests or selftests impractical) not the
> feature itself.
>
> > This reproducer is based on "tracing" automount, which
> > actually *IS* already deprecated. But automount mechanism
> > itself is not deprecated, as well as I know.
>
> The automount behaviour of tracefs is different to the general automount
> mechanism which is managed by userspace with the autofs daemon. I don't
> know the history behind the deprecation, but I expect that it was
> deprecated in favour of configuring it with autofs (or just enabling it
> by default).
>
> > Also, I did read namei code, and I think that
> > options AT_NO_AUTOMOUNT, FSPICK_NO_AUTOMOUNT, etc affect
> > last component only, not all of them. I didn't test this yet.
> > I plan to test this within next days.
>
> No, LOOKUP_AUTOMOUNT affects all components. I double-checked this with
> Christian.
Hm? I was asking the question in the chat because I was unsure and not
in front of a computer you then said that it does affect all components. :)
>
> You would think that it's only the last component (like O_DIRECTORY,
> O_NOFOLLOW, AT_SYMLINK_{,NO}FOLLOW) but follow_automount() is called for
> all components (i.e., as part of step_into()). It hooks into the regular
> lookup flow for mountpoints.
>
> Yes, it is quite funky that AT_NO_AUTOMOUNT is the only AT_* flag that
> works this way -- hence why I went with a different RESOLVE_* namespace
> for openat2() (which _always_ act on _all_ components).
>
> --
> Aleksa Sarai
> Senior Software Engineer (Containers)
> SUSE Linux GmbH
> https://www.cyphar.com/
next prev parent reply other threads:[~2025-08-19 8:31 UTC|newest]
Thread overview: 49+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-08 20:39 [PATCH v3 00/12] man2: document "new" mount API Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 01/12] man/man2/statx.2: correctly document AT_NO_AUTOMOUNT Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 02/12] man/man2/mount_setattr.2: fix stray quote in SYNOPSIS Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 03/12] man/man2/mount_setattr.2: move mount_attr struct to mount_attr(2type) Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 04/12] man/man2/fsopen.2: document "new" mount API Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 05/12] man/man2/fspick.2: " Aleksa Sarai
2025-08-22 13:23 ` Askar Safin
2025-08-22 13:40 ` Aleksa Sarai
2025-08-25 16:22 ` Askar Safin
2025-08-08 20:39 ` [PATCH v3 06/12] man/man2/fsconfig.2: " Aleksa Sarai
2025-08-12 18:25 ` Aleksa Sarai
2025-08-21 9:42 ` Askar Safin
2025-08-21 11:44 ` Aleksa Sarai
2025-08-21 11:57 ` Askar Safin
2025-08-21 10:25 ` Askar Safin
2025-08-21 11:47 ` Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 07/12] man/man2/fsmount.2: " Aleksa Sarai
2025-08-12 9:16 ` Askar Safin
2025-08-12 14:33 ` Aleksa Sarai
2025-08-12 16:18 ` Aleksa Sarai
2025-08-20 9:55 ` Askar Safin
2025-08-20 10:38 ` Aleksa Sarai
2025-08-20 11:53 ` Askar Safin
2025-08-08 20:39 ` [PATCH v3 08/12] man/man2/move_mount.2: " Aleksa Sarai
2025-08-12 10:00 ` Askar Safin
2025-08-12 14:36 ` Aleksa Sarai
2025-08-20 11:18 ` Askar Safin
2025-08-08 20:39 ` [PATCH v3 09/12] man/man2/open_tree.2: " Aleksa Sarai
2025-08-21 11:27 ` Askar Safin
2025-08-21 11:33 ` Christian Brauner
2025-08-24 6:53 ` Askar Safin
2025-08-08 20:39 ` [PATCH v3 10/12] man/man2/mount_setattr.2: mirror opening sentence from fsopen(2) Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 11/12] man/man2/open_tree{,_attr}.2: document new open_tree_attr() API Aleksa Sarai
2025-08-08 20:39 ` [PATCH v3 12/12] man/man2/{fsconfig,mount_setattr}.2: add note about attribute-parameter distinction Aleksa Sarai
2025-08-09 15:04 ` [PATCH v3 00/12] man2: document "new" mount API Askar Safin
2025-08-09 15:11 ` Alejandro Colomar
2025-08-09 17:32 ` Aleksa Sarai
2025-08-11 11:27 ` Alejandro Colomar
2025-08-17 7:52 ` Askar Safin
2025-08-17 16:16 ` Aleksa Sarai
2025-08-17 18:50 ` Askar Safin
2025-08-18 5:46 ` Aleksa Sarai
2025-08-19 8:31 ` Christian Brauner [this message]
2025-08-19 8:50 ` Aleksa Sarai
2025-08-20 11:37 ` Askar Safin
2025-08-21 11:49 ` Aleksa Sarai
2025-08-21 12:14 ` Askar Safin
2025-08-21 14:21 ` Aleksa Sarai
2025-08-24 13:07 ` Askar Safin
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=20250819-erhitzen-knacken-e4d52248ca3e@brauner \
--to=brauner@kernel.org \
--cc=alx@kernel.org \
--cc=autofs@vger.kernel.org \
--cc=cyphar@cyphar.com \
--cc=dhowells@redhat.com \
--cc=g.branden.robinson@gmail.com \
--cc=jack@suse.cz \
--cc=linux-api@vger.kernel.org \
--cc=linux-fsdevel@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-man@vger.kernel.org \
--cc=mtk.manpages@gmail.com \
--cc=raven@themaw.net \
--cc=safinaskar@zohomail.com \
--cc=viro@zeniv.linux.org.uk \
/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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox