[<prev] [next>] [day] [month] [year] [list]
Message-ID: <202111171725.4A81JVz7-lkp@intel.com>
Date: Wed, 17 Nov 2021 17:15:37 +0800
From: kernel test robot <lkp@...el.com>
To: Xiaoming Ni <nixiaoming@...wei.com>
Cc: kbuild-all@...ts.01.org, linux-kernel@...r.kernel.org,
Luis Chamberlain <mcgrof@...nel.org>
Subject: [mcgrof-next:20211116-sysctl-cleanups-v4 21/35]
kernel/printk/sysctl.c:20:51: sparse: sparse: incorrect type in argument 3
(different address spaces)
tree: https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git 20211116-sysctl-cleanups-v4
head: 5347239461f25fc50aa761923245b9ec4a4aafec
commit: b8c066c91c9a2a236ca09ea16d967448bdbe7bb0 [21/35] printk: move printk sysctl to printk/sysctl.c
config: m68k-randconfig-s031-20211117 (attached as .config)
compiler: m68k-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://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git/commit/?id=b8c066c91c9a2a236ca09ea16d967448bdbe7bb0
git remote add mcgrof-next https://git.kernel.org/pub/scm/linux/kernel/git/mcgrof/linux-next.git
git fetch --no-tags mcgrof-next 20211116-sysctl-cleanups-v4
git checkout b8c066c91c9a2a236ca09ea16d967448bdbe7bb0
# save the attached .config to linux build tree
COMPILER_INSTALL_PATH=$HOME/0day COMPILER=gcc-11.2.0 make.cross C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' ARCH=m68k
If you fix the issue, kindly add following tag as appropriate
Reported-by: kernel test robot <lkp@...el.com>
sparse warnings: (new ones prefixed by >>)
>> kernel/printk/sysctl.c:20:51: sparse: sparse: incorrect type in argument 3 (different address spaces) @@ expected void * @@ got void [noderef] __user *buffer @@
kernel/printk/sysctl.c:20:51: sparse: expected void *
kernel/printk/sysctl.c:20:51: sparse: got void [noderef] __user *buffer
>> kernel/printk/sysctl.c:66:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
kernel/printk/sysctl.c:66:35: sparse: expected int ( [usertype] *proc_handler )( ... )
kernel/printk/sysctl.c:66:35: sparse: got int ( * )( ... )
kernel/printk/sysctl.c:75:35: sparse: sparse: incorrect type in initializer (incompatible argument 3 (different address spaces)) @@ expected int ( [usertype] *proc_handler )( ... ) @@ got int ( * )( ... ) @@
kernel/printk/sysctl.c:75:35: sparse: expected int ( [usertype] *proc_handler )( ... )
kernel/printk/sysctl.c:75:35: sparse: got int ( * )( ... )
vim +20 kernel/printk/sysctl.c
13
14 static int proc_dointvec_minmax_sysadmin(struct ctl_table *table, int write,
15 void __user *buffer, size_t *lenp, loff_t *ppos)
16 {
17 if (write && !capable(CAP_SYS_ADMIN))
18 return -EPERM;
19
> 20 return proc_dointvec_minmax(table, write, buffer, lenp, ppos);
21 }
22
23 static struct ctl_table printk_sysctls[] = {
24 {
25 .procname = "printk",
26 .data = &console_loglevel,
27 .maxlen = 4*sizeof(int),
28 .mode = 0644,
29 .proc_handler = proc_dointvec,
30 },
31 {
32 .procname = "printk_ratelimit",
33 .data = &printk_ratelimit_state.interval,
34 .maxlen = sizeof(int),
35 .mode = 0644,
36 .proc_handler = proc_dointvec_jiffies,
37 },
38 {
39 .procname = "printk_ratelimit_burst",
40 .data = &printk_ratelimit_state.burst,
41 .maxlen = sizeof(int),
42 .mode = 0644,
43 .proc_handler = proc_dointvec,
44 },
45 {
46 .procname = "printk_delay",
47 .data = &printk_delay_msec,
48 .maxlen = sizeof(int),
49 .mode = 0644,
50 .proc_handler = proc_dointvec_minmax,
51 .extra1 = SYSCTL_ZERO,
52 .extra2 = (void *)&ten_thousand,
53 },
54 {
55 .procname = "printk_devkmsg",
56 .data = devkmsg_log_str,
57 .maxlen = DEVKMSG_STR_MAX_SIZE,
58 .mode = 0644,
59 .proc_handler = devkmsg_sysctl_set_loglvl,
60 },
61 {
62 .procname = "dmesg_restrict",
63 .data = &dmesg_restrict,
64 .maxlen = sizeof(int),
65 .mode = 0644,
> 66 .proc_handler = proc_dointvec_minmax_sysadmin,
67 .extra1 = SYSCTL_ZERO,
68 .extra2 = SYSCTL_ONE,
69 },
70 {
71 .procname = "kptr_restrict",
72 .data = &kptr_restrict,
73 .maxlen = sizeof(int),
74 .mode = 0644,
75 .proc_handler = proc_dointvec_minmax_sysadmin,
76 .extra1 = SYSCTL_ZERO,
77 .extra2 = SYSCTL_TWO,
78 },
79 {}
80 };
81
---
0-DAY CI Kernel Test Service, Intel Corporation
https://lists.01.org/hyperkitty/list/kbuild-all@lists.01.org
Download attachment ".config.gz" of type "application/gzip" (23722 bytes)
Powered by blists - more mailing lists