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: x86_64-randconfig-s021-20211214
(
https://download.01.org/0day-ci/archive/20211215/202112151809.wxOe39yF-lk...)
compiler: gcc-9 (Debian 9.3.0-22) 9.3.0
reproduce:
# apt-get install sparse
# sparse version: v0.6.4-dirty
#
https://github.com/0day-ci/linux/commit/9faa0d15bc0e13d7f3d4737ac4b8b9f7d...
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 9faa0d15bc0e13d7f3d4737ac4b8b9f7d33bc641
# save the config file to linux build tree
mkdir build_dir
make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir
ARCH=x86_64 SHELL=/bin/bash arch/x86/kernel/fpu/
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 >>)
arch/x86/kernel/fpu/signal.c: note: in included file (through
include/asm-generic/bitops/instrumented-atomic.h, arch/x86/include/asm/bitops.h,
include/linux/bitops.h, ...):
> include/linux/instrumented.h:121:28: sparse: sparse: incorrect
type in argument 1 (different address spaces) @@ expected void const *to @@ got
void [noderef] __user *to @@
include/linux/instrumented.h:121:28: sparse:
expected void const *to
include/linux/instrumented.h:121:28: sparse: got void [noderef] __user *to
> include/linux/instrumented.h:121:28: sparse: sparse: incorrect
type in argument 1 (different address spaces) @@ expected void const *to @@ got
void [noderef] __user *to @@
include/linux/instrumented.h:121:28: sparse:
expected void const *to
include/linux/instrumented.h:121:28: sparse: got void [noderef] __user *to
vim +121 include/linux/instrumented.h
105
106 /**
107 * instrument_copy_to_user - instrument reads of copy_to_user
108 *
109 * Instrument reads from kernel memory, that are due to copy_to_user (and
110 * variants). The instrumentation must be inserted before the accesses.
111 *
112 * @to destination address
113 * @from source address
114 * @n number of bytes to copy
115 */
116 static __always_inline void
117 instrument_copy_to_user(void __user *to, const void *from, unsigned long n)
118 {
119 kasan_check_read(from, n);
120 kcsan_check_read(from, n);
121 kmsan_copy_to_user(to, from, n, 0);
122 }
123
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org