All of lore.kernel.org
 help / color / mirror / Atom feed
From: kernel test robot <lkp@intel.com>
To: Gabriele Monaco <gmonaco@redhat.com>
Cc: oe-kbuild-all@lists.linux.dev
Subject: [glemco:staging_rv_bpf_monitors 14/29] kernel/trace/rv/monitors/deadline/deadline.h:111:23: sparse: sparse: incorrect type in assignment (different address spaces)
Date: Sat, 07 Mar 2026 05:59:21 +0800	[thread overview]
Message-ID: <202603070541.YX91hd1f-lkp@intel.com> (raw)

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/gmonaco/linux.git staging_rv_bpf_monitors
head:   11b61a32f588d34caa7cc11204224b8bc95a0f01
commit: d00a7c35d280ccd0e5e0e796a3f5f606543fa992 [14/29] rv: Add deadline monitors
config: i386-randconfig-063-20260307 (https://download.01.org/0day-ci/archive/20260307/202603070541.YX91hd1f-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
sparse: v0.6.5-rc1
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260307/202603070541.YX91hd1f-lkp@intel.com/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 <lkp@intel.com>
| Closes: https://lore.kernel.org/oe-kbuild-all/202603070541.YX91hd1f-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   kernel/trace/rv/monitors/nomiss/nomiss.c: note: in included file:
>> kernel/trace/rv/monitors/deadline/deadline.h:111:23: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected struct sched_attr [noderef] __user *uattr @@     got void * @@
   kernel/trace/rv/monitors/deadline/deadline.h:111:23: sparse:     expected struct sched_attr [noderef] __user *uattr
   kernel/trace/rv/monitors/deadline/deadline.h:111:23: sparse:     got void *
>> 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 +111 kernel/trace/rv/monitors/deadline/deadline.h

    93	
    94	static inline int extract_params(struct pt_regs *regs, long id, struct task_struct **p)
    95	{
    96		size_t size = offsetof(struct sched_attr, sched_nice);
    97		struct sched_attr __user *uattr, attr;
    98		int new_policy = -1, ret;
    99		unsigned long args[6];
   100		pid_t pid;
   101	
   102		switch (id) {
   103		case __NR_sched_setscheduler:
   104			syscall_get_arguments(current, regs, args);
   105			pid = args[0];
   106			new_policy = args[1];
   107			break;
   108		case __NR_sched_setattr:
   109			syscall_get_arguments(current, regs, args);
   110			pid = args[0];
 > 111			uattr = (void *)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		if (!pid)
   126			*p = current;
   127		else {
   128			/*
   129			 * Required for find_task_by_vpid, make sure the caller doesn't
   130			 * need to get_task_struct().
   131			 */
   132			guard(rcu)();
   133			*p = find_task_by_vpid(pid);
   134			if (unlikely(!*p))
   135				return -EINVAL;
   136		}
   137	
   138		return new_policy & ~SCHED_RESET_ON_FORK;
   139	}
   140	

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

                 reply	other threads:[~2026-03-06 22:00 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=202603070541.YX91hd1f-lkp@intel.com \
    --to=lkp@intel.com \
    --cc=gmonaco@redhat.com \
    --cc=oe-kbuild-all@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.