Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1636066 > unrolled thread
| Started by | David Howells <dhowells@redhat.com> |
|---|---|
| First post | 2017-05-05 00:40 +0200 |
| Last post | 2017-05-05 02:00 +0200 |
| Articles | 2 — 2 participants |
Back to article view | Back to linux.kernel
[PATCH] Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx() David Howells <dhowells@redhat.com> - 2017-05-05 00:40 +0200
Re: [PATCH] Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx() Al Viro <viro@ZenIV.linux.org.uk> - 2017-05-05 02:00 +0200
| From | David Howells <dhowells@redhat.com> |
|---|---|
| Date | 2017-05-05 00:40 +0200 |
| Subject | [PATCH] Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx() |
| Message-ID | <tDxzI-1f6-3@gated-at.bofh.it> |
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
---
include/linux/fs.h | 8 +++++---
1 file changed, 5 insertions(+), 3 deletions(-)
diff --git a/include/linux/fs.h b/include/linux/fs.h
index 5d62d2c47939..626a6aed4485 100644
--- a/include/linux/fs.h
+++ b/include/linux/fs.h
@@ -2926,17 +2926,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)
{
[toc] | [next] | [standalone]
| From | Al Viro <viro@ZenIV.linux.org.uk> |
|---|---|
| Date | 2017-05-05 02:00 +0200 |
| Subject | Re: [PATCH] Make stat/lstat/fstatat pass AT_NO_AUTOMOUNT to vfs_statx() |
| Message-ID | <tDyP7-1ZE-1@gated-at.bofh.it> |
| In reply to | #1636066 |
On Thu, May 04, 2017 at 11:30:16PM +0100, David Howells wrote: > 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. Applied.
[toc] | [prev] | [standalone]
Back to top | Article view | linux.kernel
csiph-web