Skip to contentSkip to conversation

kernel/trace/rv/monitors/deadline/deadline.h:115:46: sparse: sparse: incorrect type in argument 1 (different address spaces)

PATCH kernel test robot 1 participant 1 message Apr 15

lore
Share & tools
lore

kernel test robot

author build bot
#0 lore raw
tree:   https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master
head:   e6efabc0afca02efa263aba533f35d90117ab283
commit: b133207deb72609ad4da40c4d50128a5e150677b [9401/13789] rv: Add nomiss deadline monitor
config: um-randconfig-r134-20260415 (https://download.01.org/0day-ci/archive/20260415/[email protected]/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260415/[email protected]/reproduce)

If you fix the issue in a separate patch/commit (i.e. not just a new version of the same patch/commit), kindly add following tags
| Reported-by: kernel test robot <[email protected]>
| Closes: https://lore.kernel.org/oe-kbuild-all/[email protected]/

sparse warnings: (new ones prefixed by >>)
kernel/trace/rv/monitors/nomiss/nomiss.c: note: in included file:

>> kernel/trace/rv/monitors/deadline/deadline.h:115:46: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void *dst @@     got struct sched_attr [noderef] __user * @@
   kernel/trace/rv/monitors/deadline/deadline.h:115:46: sparse:     expected void *dst
   kernel/trace/rv/monitors/deadline/deadline.h:115:46: sparse:     got struct sched_attr [noderef] __user *
>> kernel/trace/rv/monitors/deadline/deadline.h:118:21: sparse: sparse: dereference of noderef expression

kernel/trace/rv/monitors/deadline/deadline.h:120:30: sparse: sparse: dereference of noderef expression

vim +115 kernel/trace/rv/monitors/deadline/deadline.h

    94	
    95	static inline int extract_params(struct pt_regs *regs, long id, pid_t *pid_out)
    96	{
    97		size_t size = offsetofend(struct sched_attr, sched_flags);
    98		struct sched_attr __user *uattr, attr;
    99		int new_policy = -1, ret;
   100		unsigned long args[6];
   101	
   102		switch (id) {
   103		case __NR_sched_setscheduler:
   104			syscall_get_arguments(current, regs, args);
   105			*pid_out = args[0];
   106			new_policy = args[1];
   107			break;
   108		case __NR_sched_setattr:
   109			syscall_get_arguments(current, regs, args);
   110			*pid_out = args[0];
   111			uattr = (struct sched_attr __user *)args[1];
   112			/*
   113			 * Just copy up to sched_flags, we are not interested after that
   114			 */
 > 115			ret = copy_struct_from_user(&attr, size, uattr, size);
   116			if (ret)
   117				return ret;
 > 118			if (attr.sched_flags & SCHED_FLAG_KEEP_POLICY)

119 return -EINVAL;
120 new_policy = attr.sched_policy;
121 break;
122 default:
123 return -EINVAL;
124 }
125
126 return new_policy & ~SCHED_RESET_ON_FORK;
127 }
128

Signature · 2 lines
0-DAY CI Kernel Test Service
https://github.com/intel/lkp-tests/wiki