[vfs:work.uaccess 94/110] fs/statfs.c:261:9: error: incompatible type for argument 1 of 'memset'

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tree:   https://git.kernel.org/pub/scm/linux/kernel/git/viro/vfs.git work.uaccess
head:   8ff789cacc36a22e0a4818f5b080973b47aeb287
commit: ba41252eb5efc560e73a44061206ddd01965f5ea [94/110] compat statfs: switch to copy_to_user()
config: x86_64-randconfig-x019-201723 (attached as .config)
compiler: gcc-6 (Debian 6.2.0-3) 6.2.0 20160901
reproduce:
        git checkout ba41252eb5efc560e73a44061206ddd01965f5ea
        # save the attached .config to linux build tree
        make ARCH=x86_64 

All errors (new ones prefixed by >>):

   fs/statfs.c: In function 'put_compat_statfs':
>> fs/statfs.c:261:9: error: incompatible type for argument 1 of 'memset'
     memset(buf, 0, sizeof(struct compat_statfs));
            ^~~
   In file included from arch/x86/include/asm/string.h:4:0,
                    from include/linux/string.h:18,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from arch/x86/include/asm/cpumask.h:4,
                    from arch/x86/include/asm/msr.h:10,
                    from arch/x86/include/asm/processor.h:20,
                    from arch/x86/include/asm/cpufeature.h:4,
                    from arch/x86/include/asm/thread_info.h:52,
                    from include/linux/thread_info.h:37,
                    from arch/x86/include/asm/preempt.h:6,
                    from include/linux/preempt.h:80,
                    from include/linux/spinlock.h:50,
                    from include/linux/seqlock.h:35,
                    from include/linux/time.h:5,
                    from arch/x86/include/uapi/asm/signal.h:6,
                    from arch/x86/include/asm/signal.h:35,
                    from include/uapi/linux/signal.h:4,
                    from include/linux/signal_types.h:9,
                    from include/linux/signal.h:5,
                    from include/linux/syscalls.h:74,
                    from fs/statfs.c:1:
   arch/x86/include/asm/string_64.h:56:7: note: expected 'void *' but argument is of type 'struct compat_statfs'
    void *memset(void *s, int c, size_t n);
          ^~~~~~
>> fs/statfs.c:274:25: error: incompatible type for argument 2 of 'copy_to_user'
     if (copy_to_user(ubuf, buf, sizeof(struct compat_statfs)))
                            ^~~
   In file included from include/linux/poll.h:11:0,
                    from include/linux/ring_buffer.h:7,
                    from include/linux/trace_events.h:5,
                    from include/trace/syscall.h:6,
                    from include/linux/syscalls.h:82,
                    from fs/statfs.c:1:
   include/linux/uaccess.h:164:1: note: expected 'const void *' but argument is of type 'struct compat_statfs'
    copy_to_user(void __user *to, const void *from, unsigned long n)
    ^~~~~~~~~~~~
   fs/statfs.c: In function 'put_compat_statfs64':
   fs/statfs.c:317:9: error: incompatible type for argument 1 of 'memset'
     memset(buf, 0, sizeof(struct compat_statfs));
            ^~~
   In file included from arch/x86/include/asm/string.h:4:0,
                    from include/linux/string.h:18,
                    from include/linux/bitmap.h:8,
                    from include/linux/cpumask.h:11,
                    from arch/x86/include/asm/cpumask.h:4,
                    from arch/x86/include/asm/msr.h:10,
                    from arch/x86/include/asm/processor.h:20,
                    from arch/x86/include/asm/cpufeature.h:4,
                    from arch/x86/include/asm/thread_info.h:52,
                    from include/linux/thread_info.h:37,
                    from arch/x86/include/asm/preempt.h:6,
                    from include/linux/preempt.h:80,
                    from include/linux/spinlock.h:50,
                    from include/linux/seqlock.h:35,
                    from include/linux/time.h:5,
                    from arch/x86/include/uapi/asm/signal.h:6,
                    from arch/x86/include/asm/signal.h:35,
                    from include/uapi/linux/signal.h:4,
                    from include/linux/signal_types.h:9,
                    from include/linux/signal.h:5,
                    from include/linux/syscalls.h:74,
                    from fs/statfs.c:1:
   arch/x86/include/asm/string_64.h:56:7: note: expected 'void *' but argument is of type 'struct compat_statfs64'
    void *memset(void *s, int c, size_t n);
          ^~~~~~
   fs/statfs.c:330:25: error: incompatible type for argument 2 of 'copy_to_user'
     if (copy_to_user(ubuf, buf, sizeof(struct compat_statfs)))
                            ^~~
   In file included from include/linux/poll.h:11:0,
                    from include/linux/ring_buffer.h:7,
                    from include/linux/trace_events.h:5,
                    from include/trace/syscall.h:6,
                    from include/linux/syscalls.h:82,
                    from fs/statfs.c:1:
   include/linux/uaccess.h:164:1: note: expected 'const void *' but argument is of type 'struct compat_statfs64'
    copy_to_user(void __user *to, const void *from, unsigned long n)
    ^~~~~~~~~~~~

vim +/memset +261 fs/statfs.c

   255			 && (kbuf->f_files & 0xffffffff00000000ULL))
   256				return -EOVERFLOW;
   257			if (kbuf->f_ffree != 0xffffffffffffffffULL
   258			 && (kbuf->f_ffree & 0xffffffff00000000ULL))
   259				return -EOVERFLOW;
   260		}
 > 261		memset(buf, 0, sizeof(struct compat_statfs));
   262		buf.f_type = kbuf->f_type;
   263		buf.f_bsize = kbuf->f_bsize;
   264		buf.f_blocks = kbuf->f_blocks;
   265		buf.f_bfree = kbuf->f_bfree;
   266		buf.f_bavail = kbuf->f_bavail;
   267		buf.f_files = kbuf->f_files;
   268		buf.f_ffree = kbuf->f_ffree;
   269		buf.f_namelen = kbuf->f_namelen;
   270		buf.f_fsid.val[0] = kbuf->f_fsid.val[0];
   271		buf.f_fsid.val[1] = kbuf->f_fsid.val[1];
   272		buf.f_frsize = kbuf->f_frsize;
   273		buf.f_flags = kbuf->f_flags;
 > 274		if (copy_to_user(ubuf, buf, sizeof(struct compat_statfs)))
   275			return -EFAULT;
   276		return 0;
   277	}

---
0-DAY kernel test infrastructure                Open Source Technology Center
https://lists.01.org/pipermail/kbuild-all                   Intel Corporation

Attachment: .config.gz
Description: application/gzip


[Index of Archives]     [Linux Ext4 Filesystem]     [Union Filesystem]     [Filesystem Testing]     [Ceph Users]     [Ecryptfs]     [AutoFS]     [Kernel Newbies]     [Share Photos]     [Security]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux Cachefs]     [Reiser Filesystem]     [Linux RAID]     [Samba]     [Device Mapper]     [CEPH Development]
  Powered by Linux