summaryrefslogtreecommitdiff
path: root/fs/stat.c
diff options
context:
space:
mode:
authorDavid Howells <dhowells@redhat.com>2017-03-31 20:32:10 +0300
committerAl Viro <viro@zeniv.linux.org.uk>2017-04-03 08:05:59 +0300
commit47071aee6a1956524b9929b3b821f6d2f8cae23c (patch)
treeac2a548058e4eed0a029e22a9d86b255e5159e5f /fs/stat.c
parent5f955f26f3d42d04aba65590a32eb70eedb7f37d (diff)
downloadlinux-47071aee6a1956524b9929b3b821f6d2f8cae23c.tar.xz
statx: Reserve the top bit of the mask for future struct expansion
Reserve the top bit of the mask for future expansion of the statx struct and give an error if statx() sees it set. All the other bits are ignored if we see them set but don't support the bit; we just clear the bit in the returned mask. Signed-off-by: David Howells <dhowells@redhat.com> Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
Diffstat (limited to 'fs/stat.c')
-rw-r--r--fs/stat.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/fs/stat.c b/fs/stat.c
index ab27f2868588..0c7e6cdc435c 100644
--- a/fs/stat.c
+++ b/fs/stat.c
@@ -562,6 +562,8 @@ SYSCALL_DEFINE5(statx,
struct kstat stat;
int error;
+ if (mask & STATX__RESERVED)
+ return -EINVAL;
if ((flags & AT_STATX_SYNC_TYPE) == AT_STATX_SYNC_TYPE)
return -EINVAL;