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>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20241007130825.10326-2-xry111@xry111.site>
Date: Mon,  7 Oct 2024 21:08:22 +0800
From: Xi Ruoyao <xry111@...111.site>
To: Mateusz Guzik <mjguzik@...il.com>,
	Christian Brauner <brauner@...nel.org>
Cc: Xi Ruoyao <xry111@...111.site>,
	Miao Wang <shankerwangmiao@...il.com>,
	linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org,
	stable@...r.kernel.org
Subject: [PATCH 1/2] vfs: support fstatat(..., NULL, AT_EMPTY_PATH | AT_NO_AUTOMOUNT, ...)

Since Linux 4.11 AT_NO_AUTOMOUNT is implied for fstatat.  So we should
support this like fstatat(..., NULL, AT_EMPTY_PATH, ...) for
consistency.  Also note that statx(..., NULL, AT_EMPTY_PATH |
AT_NO_AUTOMOUNT) is already supported.

Fixes: 27a2d0cb2f38 ("stat: use vfs_empty_path() helper")
Cc: stable@...r.kernel.org
Signed-off-by: Xi Ruoyao <xry111@...111.site>
---
 fs/stat.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/fs/stat.c b/fs/stat.c
index 41e598376d7e..ed9d4fd8ba2c 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -334,6 +334,7 @@ int vfs_fstatat(int dfd, const char __user *filename,
 	 * If AT_EMPTY_PATH is set, we expect the common case to be that
 	 * empty path, and avoid doing all the extra pathname work.
 	 */
+	flags &= ~AT_NO_AUTOMOUNT;
 	if (flags == AT_EMPTY_PATH && vfs_empty_path(dfd, filename))
 		return vfs_fstat(dfd, stat);
 
-- 
2.46.2


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ