Commit 7868d9ff authored by David Howells's avatar David Howells Committed by Greg Kroah-Hartman

Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx()

commit deccf497 upstream.

stat/lstat/fstatat need to pass AT_NO_AUTOMOUNT to vfs_statx() as the
pre-statx code didn't set LOOKUP_AUTOMOUNT, even though fstatat() accepted
the AT_NO_AUTOMOUNT flag.

Fixes: a528d35e ("statx: Add a system call to make enhanced file info available")
Reported-by: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarDavid Howells <dhowells@redhat.com>
Tested-by: default avatarIan Kent <raven@themaw.net>
Signed-off-by: default avatarAl Viro <viro@zeniv.linux.org.uk>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent d0897554
......@@ -2921,17 +2921,19 @@ extern int vfs_statx_fd(unsigned int, struct kstat *, u32, unsigned int);
static inline int vfs_stat(const char __user *filename, struct kstat *stat)
{
return vfs_statx(AT_FDCWD, filename, 0, stat, STATX_BASIC_STATS);
return vfs_statx(AT_FDCWD, filename, AT_NO_AUTOMOUNT,
stat, STATX_BASIC_STATS);
}
static inline int vfs_lstat(const char __user *name, struct kstat *stat)
{
return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW,
return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT,
stat, STATX_BASIC_STATS);
}
static inline int vfs_fstatat(int dfd, const char __user *filename,
struct kstat *stat, int flags)
{
return vfs_statx(dfd, filename, flags, stat, STATX_BASIC_STATS);
return vfs_statx(dfd, filename, flags | AT_NO_AUTOMOUNT,
stat, STATX_BASIC_STATS);
}
static inline int vfs_fstat(int fd, struct kstat *stat)
{
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment