Re: [RFC PATCH v14 06/10] landlock: Add syscall implementation

From
Mickaël Salaün <mic@digikod.net>
Date
2020-03-17 17:51:51
Also in
linux-api, linux-arch, linux-doc, linux-fsdevel, linux-kselftest, lkml
Reply to
Al Viro, 2020-03-17
On 17/03/2020 17:47, Al Viro wrote:
On Mon, Feb 24, 2020 at 05:02:11PM +0100, Mickaël Salaün wrote:
quoted
+static int get_path_from_fd(u64 fd, struct path *path)
quoted
+	/*
+	 * Only allows O_PATH FD: enable to restrict ambiant (FS) accesses
+	 * without requiring to open and risk leaking or misuing a FD.  Accept
+	 * removed, but still open directory (S_DEAD).
+	 */
+	if (!(f.file->f_mode & FMODE_PATH) || !f.file->f_path.mnt ||
					      ^^^^^^^^^^^^^^^^^^^
Could you explain what that one had been be about?  The underlined
subexpression is always false; was that supposed to check some
condition and if so, which one?
This was just to be sure that the next assignment "path->mnt =
f.file->f_path.mnt;" always creates a valid path. If this is always
true, I will remove it.
Thread (34 messages) 34 messages, 5 authors, last reply 2020-03-30
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help