[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <2025-08-21.1755776734-magenta-shaved-atrium-spacebar-n0zDCn@cyphar.com>
Date: Thu, 21 Aug 2025 21:47:17 +1000
From: Aleksa Sarai <cyphar@...har.com>
To: Askar Safin <safinaskar@...omail.com>
Cc: Alejandro Colomar <alx@...nel.org>,
"Michael T. Kerrisk" <mtk.manpages@...il.com>, Alexander Viro <viro@...iv.linux.org.uk>,
Jan Kara <jack@...e.cz>, "G. Branden Robinson" <g.branden.robinson@...il.com>,
linux-man <linux-man@...r.kernel.org>, linux-api <linux-api@...r.kernel.org>,
linux-fsdevel <linux-fsdevel@...r.kernel.org>, linux-kernel <linux-kernel@...r.kernel.org>,
David Howells <dhowells@...hat.com>, Christian Brauner <brauner@...nel.org>
Subject: Re: [PATCH v3 06/12] man/man2/fsconfig.2: document "new" mount API
On 2025-08-21, Askar Safin <safinaskar@...omail.com> wrote:
> There is a convention: you can pass invalid fd (such as -1) as dfd to *at-syscalls to enforce that the path is absolute.
> This is documented. "man openat" says: "Specifying an invalid file descriptor number in dirfd can be used as a means to ensure that pathname is absolute".
> But fsconfig with FSCONFIG_SET_PATH breaks this convention due to this line: https://elixir.bootlin.com/linux/v6.16/source/fs/fsopen.c#L377 .
> I think this is a bug, and it should be fixed in kernel. Also, it is possible there are a lot of similarly buggy syscalls. All of them should be fixed,
> and moreover a warning should be added to https://docs.kernel.org/process/adding-syscalls.html . And then new fsconfig behavior should be documented.
> (Of course, I'm not saying that *you* should do all these. I'm just saying that this bug exists.) (I tested this.)
Indeed, good catch! I think we discussed this before --
FSCONFIG_SET_PATH actually doesn't work with any parameters today so
it's not very surprising nobody has noticed this until now. I'll include
it in the set of fixes I have for fscontext.
(FWIW, the convention I see more commonly is -EBADF but that's just a
stylistic I suppose.)
--
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