[arm64:devel/btrfs-fix 1/2] mm/maccess.c:222: warning: expecting prototype for copy_from_user_nofault(). Prototype was for __copy_from_user_nofault() instead

kernel test robot lkp at intel.com
Tue Oct 12 08:49:27 PDT 2021


tree:   https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git devel/btrfs-fix
head:   64dd8f004e6e4f285d66f54c3515a1ee2f5dae47
commit: 68a2a8c422d312c1d717be2a0dda51ca6282b28c [1/2] uaccess: Introduce __copy_{to,from}_user_nofault() returning the bytes not copied
config: arm-randconfig-c002-20211011 (attached as .config)
compiler: clang version 14.0.0 (https://github.com/llvm/llvm-project c3dcf39554dbea780d6cb7e12239451ba47a2668)
reproduce (this is a W=1 build):
        wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/make.cross -O ~/bin/make.cross
        chmod +x ~/bin/make.cross
        # install arm cross compiling tool for clang build
        # apt-get install binutils-arm-linux-gnueabi
        # https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git/commit/?id=68a2a8c422d312c1d717be2a0dda51ca6282b28c
        git remote add arm64 https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git
        git fetch --no-tags arm64 devel/btrfs-fix
        git checkout 68a2a8c422d312c1d717be2a0dda51ca6282b28c
        # save the attached .config to linux build tree
        mkdir build_dir
        COMPILER_INSTALL_PATH=$HOME/0day COMPILER=clang make.cross W=1 O=build_dir ARCH=arm SHELL=/bin/bash

If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp at intel.com>

All warnings (new ones prefixed by >>):

>> mm/maccess.c:222: warning: expecting prototype for copy_from_user_nofault(). Prototype was for __copy_from_user_nofault() instead
>> mm/maccess.c:247: warning: expecting prototype for copy_to_user_nofault(). Prototype was for __copy_to_user_nofault() instead


vim +222 mm/maccess.c

3d7081822f7f9e Masami Hiramatsu  2019-05-15  211  
fc3562d79456bf Christoph Hellwig 2020-06-08  212  /**
c0ee37e85e0e47 Christoph Hellwig 2020-06-17  213   * copy_from_user_nofault(): safely attempt to read from a user-space location
fc3562d79456bf Christoph Hellwig 2020-06-08  214   * @dst: pointer to the buffer that shall take the data
fc3562d79456bf Christoph Hellwig 2020-06-08  215   * @src: address to read from. This must be a user address.
fc3562d79456bf Christoph Hellwig 2020-06-08  216   * @size: size of the data chunk
fc3562d79456bf Christoph Hellwig 2020-06-08  217   *
fc3562d79456bf Christoph Hellwig 2020-06-08  218   * Safely read from user address @src to the buffer at @dst. If a kernel fault
fc3562d79456bf Christoph Hellwig 2020-06-08  219   * happens, handle that and return -EFAULT.
fc3562d79456bf Christoph Hellwig 2020-06-08  220   */
68a2a8c422d312 Catalin Marinas   2021-10-09  221  unsigned long __copy_from_user_nofault(void *dst, const void __user *src, size_t size)
fc3562d79456bf Christoph Hellwig 2020-06-08 @222  {
68a2a8c422d312 Catalin Marinas   2021-10-09  223  	unsigned long ret = size;
3d13f313ce4c34 Christoph Hellwig 2020-08-11  224  	mm_segment_t old_fs = force_uaccess_begin();
fc3562d79456bf Christoph Hellwig 2020-06-08  225  
fc3562d79456bf Christoph Hellwig 2020-06-08  226  	if (access_ok(src, size)) {
fc3562d79456bf Christoph Hellwig 2020-06-08  227  		pagefault_disable();
fc3562d79456bf Christoph Hellwig 2020-06-08  228  		ret = __copy_from_user_inatomic(dst, src, size);
fc3562d79456bf Christoph Hellwig 2020-06-08  229  		pagefault_enable();
fc3562d79456bf Christoph Hellwig 2020-06-08  230  	}
3d13f313ce4c34 Christoph Hellwig 2020-08-11  231  	force_uaccess_end(old_fs);
fc3562d79456bf Christoph Hellwig 2020-06-08  232  
68a2a8c422d312 Catalin Marinas   2021-10-09  233  	return ret;
fc3562d79456bf Christoph Hellwig 2020-06-08  234  }
68a2a8c422d312 Catalin Marinas   2021-10-09  235  EXPORT_SYMBOL_GPL(__copy_from_user_nofault);
fc3562d79456bf Christoph Hellwig 2020-06-08  236  
fc3562d79456bf Christoph Hellwig 2020-06-08  237  /**
c0ee37e85e0e47 Christoph Hellwig 2020-06-17  238   * copy_to_user_nofault(): safely attempt to write to a user-space location
fc3562d79456bf Christoph Hellwig 2020-06-08  239   * @dst: address to write to
fc3562d79456bf Christoph Hellwig 2020-06-08  240   * @src: pointer to the data that shall be written
fc3562d79456bf Christoph Hellwig 2020-06-08  241   * @size: size of the data chunk
fc3562d79456bf Christoph Hellwig 2020-06-08  242   *
fc3562d79456bf Christoph Hellwig 2020-06-08  243   * Safely write to address @dst from the buffer at @src.  If a kernel fault
fc3562d79456bf Christoph Hellwig 2020-06-08  244   * happens, handle that and return -EFAULT.
fc3562d79456bf Christoph Hellwig 2020-06-08  245   */
68a2a8c422d312 Catalin Marinas   2021-10-09  246  unsigned long __copy_to_user_nofault(void __user *dst, const void *src, size_t size)
fc3562d79456bf Christoph Hellwig 2020-06-08 @247  {
68a2a8c422d312 Catalin Marinas   2021-10-09  248  	unsigned long ret = size;
3d13f313ce4c34 Christoph Hellwig 2020-08-11  249  	mm_segment_t old_fs = force_uaccess_begin();
fc3562d79456bf Christoph Hellwig 2020-06-08  250  
fc3562d79456bf Christoph Hellwig 2020-06-08  251  	if (access_ok(dst, size)) {
fc3562d79456bf Christoph Hellwig 2020-06-08  252  		pagefault_disable();
fc3562d79456bf Christoph Hellwig 2020-06-08  253  		ret = __copy_to_user_inatomic(dst, src, size);
fc3562d79456bf Christoph Hellwig 2020-06-08  254  		pagefault_enable();
fc3562d79456bf Christoph Hellwig 2020-06-08  255  	}
3d13f313ce4c34 Christoph Hellwig 2020-08-11  256  	force_uaccess_end(old_fs);
fc3562d79456bf Christoph Hellwig 2020-06-08  257  
68a2a8c422d312 Catalin Marinas   2021-10-09  258  	return ret;
fc3562d79456bf Christoph Hellwig 2020-06-08  259  }
68a2a8c422d312 Catalin Marinas   2021-10-09  260  EXPORT_SYMBOL_GPL(__copy_to_user_nofault);
fc3562d79456bf Christoph Hellwig 2020-06-08  261  

:::::: The code at line 222 was first introduced by commit
:::::: fc3562d79456bf1740b44d84b8726d20de8d39bd maccess: move user access routines together

:::::: TO: Christoph Hellwig <hch at lst.de>
:::::: CC: Linus Torvalds <torvalds at linux-foundation.org>

---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: .config.gz
Type: application/gzip
Size: 33240 bytes
Desc: not available
URL: <http://lists.infradead.org/pipermail/linux-arm-kernel/attachments/20211012/c9ca85c2/attachment-0001.gz>


More information about the linux-arm-kernel mailing list