Hi Peter, Thank you for the patch! Perhaps something to improve: [auto build test WARNING on arm64/for-next/core] [also build test WARNING on kselftest/next linus/master v5.13 next-20210701] [If your patch is applied to the wrong git tree, kindly drop us a note. And when submitting patch, we suggest to use '--base' as documented in https://git-scm.com/docs/git-format-patch] url: https://github.com/0day-ci/linux/commits/Peter-Collingbourne/userfaultfd-do-not-untag-user-pointers/20210703-065801 base: https://git.kernel.org/pub/scm/linux/kernel/git/arm64/linux.git for-next/core config: x86_64-randconfig-s032-20210702 (attached as .config) compiler: gcc-9 (Debian 9.3.0-22) 9.3.0 reproduce: # apt-get install sparse # sparse version: v0.6.3-341-g8af24329-dirty # https://github.com/0day-ci/linux/commit/42177546697fa573571799dc11ecd12a65449886 git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Peter-Collingbourne/userfaultfd-do-not-untag-user-pointers/20210703-065801 git checkout 42177546697fa573571799dc11ecd12a65449886 # save the attached .config to linux build tree make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=x86_64 If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot <lkp@xxxxxxxxx> sparse warnings: (new ones prefixed by >>) >> fs/userfaultfd.c:1816:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned long long [usertype] start @@ got unsigned long long * @@ fs/userfaultfd.c:1816:40: sparse: expected unsigned long long [usertype] start fs/userfaultfd.c:1816:40: sparse: got unsigned long long * fs/userfaultfd.c:1864:40: sparse: sparse: incorrect type in argument 2 (different base types) @@ expected unsigned long long [usertype] start @@ got unsigned long long * @@ fs/userfaultfd.c:1864:40: sparse: expected unsigned long long [usertype] start fs/userfaultfd.c:1864:40: sparse: got unsigned long long * vim +1816 fs/userfaultfd.c ad465cae96b456 Andrea Arcangeli 2015-09-04 1797 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1798 static int userfaultfd_writeprotect(struct userfaultfd_ctx *ctx, 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1799 unsigned long arg) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1800 { 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1801 int ret; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1802 struct uffdio_writeprotect uffdio_wp; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1803 struct uffdio_writeprotect __user *user_uffdio_wp; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1804 struct userfaultfd_wake_range range; 23080e2783ba45 Peter Xu 2020-04-06 1805 bool mode_wp, mode_dontwake; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1806 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1807 if (READ_ONCE(ctx->mmap_changing)) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1808 return -EAGAIN; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1809 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1810 user_uffdio_wp = (struct uffdio_writeprotect __user *) arg; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1811 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1812 if (copy_from_user(&uffdio_wp, user_uffdio_wp, 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1813 sizeof(struct uffdio_writeprotect))) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1814 return -EFAULT; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1815 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 @1816 ret = validate_range(ctx->mm, &uffdio_wp.range.start, 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1817 uffdio_wp.range.len); 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1818 if (ret) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1819 return ret; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1820 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1821 if (uffdio_wp.mode & ~(UFFDIO_WRITEPROTECT_MODE_DONTWAKE | 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1822 UFFDIO_WRITEPROTECT_MODE_WP)) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1823 return -EINVAL; 23080e2783ba45 Peter Xu 2020-04-06 1824 23080e2783ba45 Peter Xu 2020-04-06 1825 mode_wp = uffdio_wp.mode & UFFDIO_WRITEPROTECT_MODE_WP; 23080e2783ba45 Peter Xu 2020-04-06 1826 mode_dontwake = uffdio_wp.mode & UFFDIO_WRITEPROTECT_MODE_DONTWAKE; 23080e2783ba45 Peter Xu 2020-04-06 1827 23080e2783ba45 Peter Xu 2020-04-06 1828 if (mode_wp && mode_dontwake) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1829 return -EINVAL; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1830 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1831 ret = mwriteprotect_range(ctx->mm, uffdio_wp.range.start, 23080e2783ba45 Peter Xu 2020-04-06 1832 uffdio_wp.range.len, mode_wp, 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1833 &ctx->mmap_changing); 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1834 if (ret) 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1835 return ret; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1836 23080e2783ba45 Peter Xu 2020-04-06 1837 if (!mode_wp && !mode_dontwake) { 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1838 range.start = uffdio_wp.range.start; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1839 range.len = uffdio_wp.range.len; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1840 wake_userfault(ctx, &range); 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1841 } 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1842 return ret; 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1843 } 63b2d4174c4ad1 Andrea Arcangeli 2020-04-06 1844 --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all@xxxxxxxxxxxx
Attachment:
.config.gz
Description: application/gzip