lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [day] [month] [year] [list]
Message-id: <162217903209.27719.15641706922296023647@noble.neil.brown.name>
Date:   Fri, 28 May 2021 15:17:12 +1000
From:   "NeilBrown" <neilb@...e.de>
To:     Al Viro <viro@...iv.linux.org.uk>
Cc:     Andrew Morton <akpm@...ux-foundation.org>,
        LKML <linux-kernel@...r.kernel.org>,
        James Simmons <jsimmons@...radead.org>
Subject: [PATCH] vfs: allow O_PATH file descriptors for open_by_handle_at()


The purpose of the "mount_fd" arg to open_by_handle_at() is solely to
identify a particular mount.  i.e.  it indicates "a location in the
filesystem tree" which is one of the purposes of O_PATH.

So change fdget() to fdget_raw().

Cc: stable@...r.kernel.org # O_PATH introduced in 3.0+
Signed-off-by: NeilBrown <neilb@...e.de>
---

This seems generally sensible, but will particularly be useful in
preparing the Lustre filesystem for upstream.

 fs/fhandle.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/fs/fhandle.c b/fs/fhandle.c
index ec6feeccc276..0020a0afdf86 100644
--- a/fs/fhandle.c
+++ b/fs/fhandle.c
@@ -122,7 +122,7 @@ static struct vfsmount *get_vfsmount_from_fd(int fd)
 		mnt = mntget(fs->pwd.mnt);
 		spin_unlock(&fs->lock);
 	} else {
-		struct fd f = fdget(fd);
+		struct fd f = fdget_raw(fd);
 		if (!f.file)
 			return ERR_PTR(-EBADF);
 		mnt = mntget(f.file->f_path.mnt);
-- 
2.31.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ