diff options
author | David Howells <dhowells@redhat.com> | 2017-05-04 18:30:16 -0400 |
---|---|---|
committer | Al Viro <viro@zeniv.linux.org.uk> | 2017-05-04 19:52:03 -0400 |
commit | deccf497d804a4c5fca2dbfad2f104675a6f9102 (patch) | |
tree | a6944cb2b90366ef2f06c0460cefe4685dbb8e4d /include/linux/fs.h | |
parent | 563f40019d16e5299e9edd3eac37846760637076 (diff) |
Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx()
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: a528d35e8bfc ("statx: Add a system call to make enhanced file info available")
Reported-by: Ian Kent <raven@themaw.net>
Signed-off-by: David Howells <dhowells@redhat.com>
Tested-by: Ian Kent <raven@themaw.net>
cc: stable@vger.kernel.org
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'include/linux/fs.h')
-rw-r--r-- | include/linux/fs.h | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/include/linux/fs.h b/include/linux/fs.h index fc1b4faa6272..866c955314db 100644 --- a/include/linux/fs.h +++ b/include/linux/fs.h | |||
@@ -2920,17 +2920,19 @@ extern int vfs_statx_fd(unsigned int, struct kstat *, u32, unsigned int); | |||
2920 | 2920 | ||
2921 | static inline int vfs_stat(const char __user *filename, struct kstat *stat) | 2921 | static inline int vfs_stat(const char __user *filename, struct kstat *stat) |
2922 | { | 2922 | { |
2923 | return vfs_statx(AT_FDCWD, filename, 0, stat, STATX_BASIC_STATS); | 2923 | return vfs_statx(AT_FDCWD, filename, AT_NO_AUTOMOUNT, |
2924 | stat, STATX_BASIC_STATS); | ||
2924 | } | 2925 | } |
2925 | static inline int vfs_lstat(const char __user *name, struct kstat *stat) | 2926 | static inline int vfs_lstat(const char __user *name, struct kstat *stat) |
2926 | { | 2927 | { |
2927 | return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW, | 2928 | return vfs_statx(AT_FDCWD, name, AT_SYMLINK_NOFOLLOW | AT_NO_AUTOMOUNT, |
2928 | stat, STATX_BASIC_STATS); | 2929 | stat, STATX_BASIC_STATS); |
2929 | } | 2930 | } |
2930 | static inline int vfs_fstatat(int dfd, const char __user *filename, | 2931 | static inline int vfs_fstatat(int dfd, const char __user *filename, |
2931 | struct kstat *stat, int flags) | 2932 | struct kstat *stat, int flags) |
2932 | { | 2933 | { |
2933 | return vfs_statx(dfd, filename, flags, stat, STATX_BASIC_STATS); | 2934 | return vfs_statx(dfd, filename, flags | AT_NO_AUTOMOUNT, |
2935 | stat, STATX_BASIC_STATS); | ||
2934 | } | 2936 | } |
2935 | static inline int vfs_fstat(int fd, struct kstat *stat) | 2937 | static inline int vfs_fstat(int fd, struct kstat *stat) |
2936 | { | 2938 | { |