* [intel-lts:5.10/android-civ 21771/23680] fs/userfaultfd.c:1875:39: warning: passing argument 2 of 'validate_range' makes integer from pointer without a cast
@ 2021-12-04 21:06 kernel test robot
0 siblings, 0 replies; only message in thread
From: kernel test robot @ 2021-12-04 21:06 UTC (permalink / raw)
To: kbuild-all
[-- Attachment #1: Type: text/plain, Size: 7081 bytes --]
tree: https://github.com/intel/linux-intel-lts.git 5.10/android-civ
head: 0e493748b235bf61d817dabdad2832ac4e932217
commit: 532f15c329f05070e3d5e8010b555dac1dac8f4b [21771/23680] Merge branch 'v5.10/yocto/20210902' into android_0902
config: arc-randconfig-r043-20211203 (https://download.01.org/0day-ci/archive/20211205/202112050455.AnhWSX7z-lkp(a)intel.com/config)
compiler: arceb-elf-gcc (GCC) 11.2.0
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
# https://github.com/intel/linux-intel-lts/commit/532f15c329f05070e3d5e8010b555dac1dac8f4b
git remote add intel-lts https://github.com/intel/linux-intel-lts.git
git fetch --no-tags intel-lts 5.10/android-civ
git checkout 532f15c329f05070e3d5e8010b555dac1dac8f4b
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross O=build_dir ARCH=arc SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@intel.com>
All warnings (new ones prefixed by >>):
fs/userfaultfd.c: In function 'userfaultfd_continue':
>> fs/userfaultfd.c:1875:39: warning: passing argument 2 of 'validate_range' makes integer from pointer without a cast [-Wint-conversion]
1875 | ret = validate_range(ctx->mm, &uffdio_continue.range.start,
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~
| |
| __u64 * {aka long long unsigned int *}
fs/userfaultfd.c:1245:49: note: expected '__u64' {aka 'long long unsigned int'} but argument is of type '__u64 *' {aka 'long long unsigned int *'}
1245 | __u64 start, __u64 len)
| ~~~~~~^~~~~
vim +/validate_range +1875 fs/userfaultfd.c
63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1855
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1856 static int userfaultfd_continue(struct userfaultfd_ctx *ctx, unsigned long arg)
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1857 {
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1858 __s64 ret;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1859 struct uffdio_continue uffdio_continue;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1860 struct uffdio_continue __user *user_uffdio_continue;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1861 struct userfaultfd_wake_range range;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1862
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1863 user_uffdio_continue = (struct uffdio_continue __user *)arg;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1864
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1865 ret = -EAGAIN;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1866 if (READ_ONCE(ctx->mmap_changing))
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1867 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1868
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1869 ret = -EFAULT;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1870 if (copy_from_user(&uffdio_continue, user_uffdio_continue,
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1871 /* don't copy the output fields */
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1872 sizeof(uffdio_continue) - (sizeof(__s64))))
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1873 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1874
4a5cf92412ab1a Axel Rasmussen 2021-03-18 @1875 ret = validate_range(ctx->mm, &uffdio_continue.range.start,
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1876 uffdio_continue.range.len);
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1877 if (ret)
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1878 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1879
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1880 ret = -EINVAL;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1881 /* double check for wraparound just in case. */
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1882 if (uffdio_continue.range.start + uffdio_continue.range.len <=
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1883 uffdio_continue.range.start) {
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1884 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1885 }
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1886 if (uffdio_continue.mode & ~UFFDIO_CONTINUE_MODE_DONTWAKE)
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1887 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1888
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1889 if (mmget_not_zero(ctx->mm)) {
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1890 ret = mcopy_continue(ctx->mm, uffdio_continue.range.start,
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1891 uffdio_continue.range.len,
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1892 &ctx->mmap_changing);
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1893 mmput(ctx->mm);
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1894 } else {
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1895 return -ESRCH;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1896 }
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1897
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1898 if (unlikely(put_user(ret, &user_uffdio_continue->mapped)))
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1899 return -EFAULT;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1900 if (ret < 0)
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1901 goto out;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1902
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1903 /* len == 0 would wake all */
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1904 BUG_ON(!ret);
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1905 range.len = ret;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1906 if (!(uffdio_continue.mode & UFFDIO_CONTINUE_MODE_DONTWAKE)) {
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1907 range.start = uffdio_continue.range.start;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1908 wake_userfault(ctx, &range);
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1909 }
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1910 ret = range.len == uffdio_continue.range.len ? 0 : -EAGAIN;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1911
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1912 out:
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1913 return ret;
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1914 }
4a5cf92412ab1a Axel Rasmussen 2021-03-18 1915
:::::: The code@line 1875 was first introduced by commit
:::::: 4a5cf92412ab1a3fdf6ad24d901f5e14fd56d4fa BACKPORT: FROMGIT: userfaultfd: add UFFDIO_CONTINUE ioctl
:::::: TO: Axel Rasmussen <axelrasmussen@google.com>
:::::: CC: Todd Kjos <tkjos@google.com>
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2021-12-04 21:06 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-12-04 21:06 [intel-lts:5.10/android-civ 21771/23680] fs/userfaultfd.c:1875:39: warning: passing argument 2 of 'validate_range' makes integer from pointer without a cast kernel test robot
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.