From 7659751a7daf9f0e1553a59a8846e680c89711e0 Mon Sep 17 00:00:00 2001 From: "David S. Miller" Date: Thu, 13 Nov 2003 00:46:45 -0800 Subject: [PATCH] [COMPAT]: Fix arguments to compat statfs64 syscalls, 'sz' was missing. --- fs/compat.c | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/fs/compat.c b/fs/compat.c index 92540b64302ab..0f9ee2532f741 100644 --- a/fs/compat.c +++ b/fs/compat.c @@ -169,7 +169,6 @@ out: static int put_compat_statfs64(struct compat_statfs64 *ubuf, struct kstatfs *kbuf) { - if (sizeof ubuf->f_blocks == 4) { if ((kbuf->f_blocks | kbuf->f_bfree | kbuf->f_bavail | kbuf->f_files | kbuf->f_ffree) & @@ -192,11 +191,14 @@ static int put_compat_statfs64(struct compat_statfs64 *ubuf, struct kstatfs *kbu return 0; } -asmlinkage long compat_statfs64(const char *path, struct compat_statfs64 *buf) +asmlinkage long compat_statfs64(const char *path, compat_size_t sz, struct compat_statfs64 *buf) { struct nameidata nd; int error; + if (sz != sizeof(*buf)) + return -EINVAL; + error = user_path_walk(path, &nd); if (!error) { struct kstatfs tmp; @@ -208,12 +210,15 @@ asmlinkage long compat_statfs64(const char *path, struct compat_statfs64 *buf) return error; } -asmlinkage long compat_fstatfs64(unsigned int fd, struct compat_statfs64 *buf) +asmlinkage long compat_fstatfs64(unsigned int fd, compat_size_t sz, struct compat_statfs64 *buf) { struct file * file; struct kstatfs tmp; int error; + if (sz != sizeof(*buf)) + return -EINVAL; + error = -EBADF; file = fget(fd); if (!file) -- 2.53.0