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-KernelMe...
base:
https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git
35fa745286ac44ee26ed100c2bd2553368ad193b
config: h8300-randconfig-s032-20211214
(
https://download.01.org/0day-ci/archive/20211215/202112152204.YealkDtu-lk...)
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/a9bc41d306e2e13721a1569145cbfe732...
git remote add linux-review
https://github.com/0day-ci/linux
git fetch --no-tags linux-review
Alexander-Potapenko/Add-KernelMemorySanitizer-infrastructure/20211215-003033
git checkout a9bc41d306e2e13721a1569145cbfe7323a60aca
# save the config file to linux build tree
mkdir build_dir
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1
CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=h8300
SHELL=/bin/bash
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp(a)intel.com>
sparse warnings: (new ones prefixed by >>)
mm/nommu.c:52:5: sparse: sparse: symbol 'heap_stack_gap' was not declared.
Should it be static?
> mm/nommu.c:1674:25: sparse: sparse: incorrect type in argument 1
(different address spaces) @@ expected void [noderef] __user *to @@ got void * @@
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
(different address spaces) @@ expected void const [noderef] __user *from @@ got
void * @@
mm/nommu.c:1677:25: sparse: expected void const [noderef] __user
*from
mm/nommu.c:1677:25: sparse: got void *
> mm/nommu.c:1677:25: sparse: sparse: incorrect type in argument 2
(different address spaces) @@ expected void const [noderef] __user *from @@ got
void * @@
mm/nommu.c:1677:25: sparse: expected void const [noderef] __user
*from
mm/nommu.c:1677:25: sparse: got void *
mm/nommu.c:519:9: sparse: sparse: context imbalance in '__put_nommu_region' -
wrong count at exit
mm/nommu.c:540:13: sparse: sparse: context imbalance in 'put_nommu_region' -
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, unsigned int
gup_flags)
0ec76a110f432e David Howells 2006-09-27 1658 {
0ec76a110f432e David Howells 2006-09-27 1659 struct vm_area_struct *vma;
442486ec109678 Lorenzo Stoakes 2016-10-13 1660 int write = gup_flags &
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 = find_vma(mm, addr);
0159b141d8b1f9 David Howells 2006-09-27 1667 if (vma) {
0ec76a110f432e David Howells 2006-09-27 1668 /* don't overrun this mapping
*/
0ec76a110f432e David Howells 2006-09-27 1669 if (addr + len >=
vma->vm_end)
0ec76a110f432e David Howells 2006-09-27 1670 len = vma->vm_end - addr;
0ec76a110f432e David Howells 2006-09-27 1671
0ec76a110f432e David Howells 2006-09-27 1672 /* only read or write 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_page(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 = 0;
0ec76a110f432e David Howells 2006-09-27 1681 } else {
0ec76a110f432e David Howells 2006-09-27 1682 len = 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@lists.01.org