[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <198cc299cd9.eec1817f85794.4679093070969175955@zohomail.com>
Date: Thu, 21 Aug 2025 14:25:35 +0400
From: Askar Safin <safinaskar@...omail.com>
To: "Aleksa Sarai" <cyphar@...har.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
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.)
--
Askar Safin
https://types.pl/@safinaskar
Powered by blists - more mailing lists