Content-Type: multipart/mixed; boundary="===============0097975621555407496==" MIME-Version: 1.0 From: kernel test robot To: kbuild-all@lists.01.org Subject: Re: [PATCH 06/43] asm-generic: instrument usercopy in cacheflush.h Date: Wed, 15 Dec 2021 22:13:57 +0800 Message-ID: <202112152204.YealkDtu-lkp@intel.com> In-Reply-To: <20211214162050.660953-7-glider@google.com> List-Id: --===============0097975621555407496== Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Hi Alexander, I love your patch! Perhaps something to improve: [auto build test WARNING on tip/x86/mm] [also build test WARNING on linus/master v5.16-rc5] [cannot apply to tip/x86/core hnaz-mm/master next-20211214] [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/Alexander-Potapenko/Add-Ke= rnelMemorySanitizer-infrastructure/20211215-003033 base: https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git 35fa745= 286ac44ee26ed100c2bd2553368ad193b config: h8300-randconfig-s032-20211214 (https://download.01.org/0day-ci/arc= hive/20211215/202112152204.YealkDtu-lkp(a)intel.com/config) compiler: h8300-linux-gcc (GCC) 11.2.0 reproduce: wget https://raw.githubusercontent.com/intel/lkp-tests/master/sbin/= make.cross -O ~/bin/make.cross chmod +x ~/bin/make.cross # apt-get install sparse # sparse version: v0.6.4-dirty # https://github.com/0day-ci/linux/commit/a9bc41d306e2e13721a156914= 5cbfe7323a60aca git remote add linux-review https://github.com/0day-ci/linux git fetch --no-tags linux-review Alexander-Potapenko/Add-KernelMemo= rySanitizer-infrastructure/20211215-003033 git checkout a9bc41d306e2e13721a1569145cbfe7323a60aca # save the config file to linux build tree mkdir build_dir COMPILER_INSTALL_PATH=3D$HOME/0day COMPILER=3Dgcc-11.2.0 make.cross= C=3D1 CF=3D'-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=3Dbuild_dir ARCH=3Dh= 8300 SHELL=3D/bin/bash If you fix the issue, kindly add following tag as appropriate Reported-by: kernel test robot sparse warnings: (new ones prefixed by >>) mm/nommu.c:52:5: sparse: sparse: symbol 'heap_stack_gap' was not declare= d. Should it be static? >> mm/nommu.c:1674:25: sparse: sparse: incorrect type in argument 1 (differ= ent address spaces) @@ expected void [noderef] __user *to @@ got vo= id * @@ mm/nommu.c:1674:25: sparse: expected void [noderef] __user *to mm/nommu.c:1674:25: sparse: got void * >> mm/nommu.c:1677:25: sparse: sparse: incorrect type in argument 2 (differ= ent address spaces) @@ expected void const [noderef] __user *from @@ = got void * @@ mm/nommu.c:1677:25: sparse: expected void const [noderef] __user *fr= om mm/nommu.c:1677:25: sparse: got void * >> mm/nommu.c:1677:25: sparse: sparse: incorrect type in argument 2 (differ= ent address spaces) @@ expected void const [noderef] __user *from @@ = got void * @@ mm/nommu.c:1677:25: sparse: expected void const [noderef] __user *fr= om mm/nommu.c:1677:25: sparse: got void * mm/nommu.c:519:9: sparse: sparse: context imbalance in '__put_nommu_regi= on' - wrong count at exit mm/nommu.c:540:13: sparse: sparse: context imbalance in 'put_nommu_regio= n' - unexpected unlock vim +1674 mm/nommu.c f1820361f83d55 Kirill A. Shutemov 2014-04-07 1655 = d3f5ffcacd1528 John Hubbard 2020-12-14 1656 int __access_remote_= vm(struct mm_struct *mm, unsigned long addr, void *buf, d3f5ffcacd1528 John Hubbard 2020-12-14 1657 int len, un= signed int gup_flags) 0ec76a110f432e David Howells 2006-09-27 1658 { 0ec76a110f432e David Howells 2006-09-27 1659 struct vm_area_stru= ct *vma; 442486ec109678 Lorenzo Stoakes 2016-10-13 1660 int write =3D gup_f= lags & FOLL_WRITE; 0ec76a110f432e David Howells 2006-09-27 1661 = d8ed45c5dcd455 Michel Lespinasse 2020-06-08 1662 if (mmap_read_lock_= killable(mm)) 1e426fe28261b0 Konstantin Khlebnikov 2019-07-11 1663 return 0; 0ec76a110f432e David Howells 2006-09-27 1664 = 0ec76a110f432e David Howells 2006-09-27 1665 /* the access must = start within one of the target process's mappings */ 0159b141d8b1f9 David Howells 2006-09-27 1666 vma =3D find_vma(mm= , addr); 0159b141d8b1f9 David Howells 2006-09-27 1667 if (vma) { 0ec76a110f432e David Howells 2006-09-27 1668 /* don't overrun t= his mapping */ 0ec76a110f432e David Howells 2006-09-27 1669 if (addr + len >= =3D vma->vm_end) 0ec76a110f432e David Howells 2006-09-27 1670 len =3D vma->vm_e= nd - addr; 0ec76a110f432e David Howells 2006-09-27 1671 = 0ec76a110f432e David Howells 2006-09-27 1672 /* only read or wr= ite mappings where it is permitted */ d00c7b993712e4 David Howells 2006-09-27 1673 if (write && vma->= vm_flags & VM_MAYWRITE) 7959722b951cff Jie Zhang 2010-01-06 @1674 copy_to_user_page= (vma, NULL, addr, 7959722b951cff Jie Zhang 2010-01-06 1675 (void *) addr,= buf, len); d00c7b993712e4 David Howells 2006-09-27 1676 else if (!write &&= vma->vm_flags & VM_MAYREAD) 7959722b951cff Jie Zhang 2010-01-06 @1677 copy_from_user_pa= ge(vma, NULL, addr, 7959722b951cff Jie Zhang 2010-01-06 1678 buf, (void = *) addr, len); 0ec76a110f432e David Howells 2006-09-27 1679 else 0ec76a110f432e David Howells 2006-09-27 1680 len =3D 0; 0ec76a110f432e David Howells 2006-09-27 1681 } else { 0ec76a110f432e David Howells 2006-09-27 1682 len =3D 0; 0ec76a110f432e David Howells 2006-09-27 1683 } 0ec76a110f432e David Howells 2006-09-27 1684 = d8ed45c5dcd455 Michel Lespinasse 2020-06-08 1685 mmap_read_unlock(mm= ); f55f199b7d76a0 Mike Frysinger 2011-03-29 1686 = f55f199b7d76a0 Mike Frysinger 2011-03-29 1687 return len; f55f199b7d76a0 Mike Frysinger 2011-03-29 1688 } f55f199b7d76a0 Mike Frysinger 2011-03-29 1689 = --- 0-DAY CI Kernel Test Service, Intel Corporation https://lists.01.org/hyperkitty/list/kbuild-all(a)lists.01.org --===============0097975621555407496==--