compat: copy missing fields in compat_statfs64 to user
authorNamhyung Kim <namhyung@gmail.com>
Sun, 26 Dec 2010 16:41:54 +0000 (01:41 +0900)
committerAl Viro <viro@zeniv.linux.org.uk>
Mon, 17 Jan 2011 09:54:38 +0000 (04:54 -0500)
f_flags and f_spare fields were not copied to userspace when
compat_sys_[f]statfs64 called.

Signed-off-by: Namhyung Kim <namhyung@gmail.com>
Cc: Christoph Hellwig <hch@lst.de>
Signed-off-by: Al Viro <viro@zeniv.linux.org.uk>
fs/compat.c

index c62b5e6a1c15af6530979c59356d01e1c07c092e..f6fd0a00e6cc4737c23cd7b80c107401c422b993 100644 (file)
@@ -320,7 +320,9 @@ static int put_compat_statfs64(struct compat_statfs64 __user *ubuf, struct kstat
            __put_user(kbuf->f_namelen, &ubuf->f_namelen) ||
            __put_user(kbuf->f_fsid.val[0], &ubuf->f_fsid.val[0]) ||
            __put_user(kbuf->f_fsid.val[1], &ubuf->f_fsid.val[1]) ||
-           __put_user(kbuf->f_frsize, &ubuf->f_frsize))
+           __put_user(kbuf->f_frsize, &ubuf->f_frsize) ||
+           __put_user(kbuf->f_flags, &ubuf->f_flags) ||
+           __clear_user(ubuf->f_spare, sizeof(ubuf->f_spare)))
                return -EFAULT;
        return 0;
 }