mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
@ 2026-01-13  9:17 kernel test robot
  2026-01-13 16:58 ` Andrii Nakryiko
  0 siblings, 1 reply; 3+ messages in thread
From: kernel test robot @ 2026-01-13  9:17 UTC (permalink / raw)
  To: Mykyta Yatsenko
  Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov, Andrii Nakryiko

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   b71e635feefc852405b14620a7fc58c4c80c0f73
commit: a498ee7576de24b4b0916ce56cf2686e261a29f7 bpf: Implement dynptr copy kfuncs
date:   8 months ago
config: i386-randconfig-063-20260113 (https://download.01.org/0day-ci/archive/20260113/202601131740.6C3BdBaB-lkp@intel.com/config)
compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/202601131740.6C3BdBaB-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/202601131740.6C3BdBaB-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   kernel/trace/bpf_trace.c:835:41: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr @@     got void * @@
   kernel/trace/bpf_trace.c:835:41: sparse:     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr
   kernel/trace/bpf_trace.c:835:41: sparse:     got void *
>> kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3633:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3647:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3654:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3662:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3670:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...):
   include/linux/rcupdate.h:871:25: sparse: sparse: context imbalance in 'uprobe_prog_run' - unexpected unlock

vim +/__user +3619 kernel/trace/bpf_trace.c

  3615	
  3616	__bpf_kfunc int bpf_probe_read_user_dynptr(struct bpf_dynptr *dptr, u32 off,
  3617						   u32 size, const void __user *unsafe_ptr__ign)
  3618	{
> 3619		return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign,
  3620					 copy_user_data_nofault, NULL);
  3621	}
  3622	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
  2026-01-13  9:17 kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression kernel test robot
@ 2026-01-13 16:58 ` Andrii Nakryiko
  0 siblings, 0 replies; 3+ messages in thread
From: Andrii Nakryiko @ 2026-01-13 16:58 UTC (permalink / raw)
  To: kernel test robot
  Cc: Mykyta Yatsenko, oe-kbuild-all, linux-kernel, Alexei Starovoitov,
	Andrii Nakryiko

On Tue, Jan 13, 2026 at 1:17 AM kernel test robot <lkp@intel.com> wrote:
>
> tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
> head:   b71e635feefc852405b14620a7fc58c4c80c0f73
> commit: a498ee7576de24b4b0916ce56cf2686e261a29f7 bpf: Implement dynptr copy kfuncs
> date:   8 months ago
> config: i386-randconfig-063-20260113 (https://download.01.org/0day-ci/archive/20260113/202601131740.6C3BdBaB-lkp@intel.com/config)
> compiler: gcc-14 (Debian 14.2.0-19) 14.2.0
> reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20260113/202601131740.6C3BdBaB-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/202601131740.6C3BdBaB-lkp@intel.com/
>
> sparse warnings: (new ones prefixed by >>)
>    kernel/trace/bpf_trace.c:835:41: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr @@     got void * @@
>    kernel/trace/bpf_trace.c:835:41: sparse:     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr
>    kernel/trace/bpf_trace.c:835:41: sparse:     got void *
> >> kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
>    kernel/trace/bpf_trace.c:3633:56: sparse: sparse: cast removes address space '__user' of expression
>    kernel/trace/bpf_trace.c:3647:52: sparse: sparse: cast removes address space '__user' of expression
>    kernel/trace/bpf_trace.c:3654:56: sparse: sparse: cast removes address space '__user' of expression
>    kernel/trace/bpf_trace.c:3662:52: sparse: sparse: cast removes address space '__user' of expression
>    kernel/trace/bpf_trace.c:3670:56: sparse: sparse: cast removes address space '__user' of expression

this is intentional, but what if we cast void __user * to long and
then to void *, would that go away? Mykyta, do you mind trying?

>    kernel/trace/bpf_trace.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...):
>    include/linux/rcupdate.h:871:25: sparse: sparse: context imbalance in 'uprobe_prog_run' - unexpected unlock
>
> vim +/__user +3619 kernel/trace/bpf_trace.c
>
>   3615
>   3616  __bpf_kfunc int bpf_probe_read_user_dynptr(struct bpf_dynptr *dptr, u32 off,
>   3617                                             u32 size, const void __user *unsafe_ptr__ign)
>   3618  {
> > 3619          return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign,
>   3620                                   copy_user_data_nofault, NULL);
>   3621  }
>   3622
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests/wiki

^ permalink raw reply	[flat|nested] 3+ messages in thread

* kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
@ 2025-12-11  2:45 kernel test robot
  0 siblings, 0 replies; 3+ messages in thread
From: kernel test robot @ 2025-12-11  2:45 UTC (permalink / raw)
  To: Mykyta Yatsenko
  Cc: oe-kbuild-all, linux-kernel, Alexei Starovoitov, Andrii Nakryiko

tree:   https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
head:   8c8081cc599fcafa25371d50959c17e154f9fd08
commit: a498ee7576de24b4b0916ce56cf2686e261a29f7 bpf: Implement dynptr copy kfuncs
date:   7 months ago
config: x86_64-randconfig-123-20251211 (https://download.01.org/0day-ci/archive/20251211/202512111057.s2Tp972J-lkp@intel.com/config)
compiler: clang version 20.1.8 (https://github.com/llvm/llvm-project 87f0227cb60147a26a1eeb4fb06e3b505e9c7261)
reproduce (this is a W=1 build): (https://download.01.org/0day-ci/archive/20251211/202512111057.s2Tp972J-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/202512111057.s2Tp972J-lkp@intel.com/

sparse warnings: (new ones prefixed by >>)
   kernel/trace/bpf_trace.c:835:41: sparse: sparse: incorrect type in assignment (different address spaces) @@     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr @@     got void * @@
   kernel/trace/bpf_trace.c:835:41: sparse:     expected void [noderef] __user *[addressable] [assigned] [usertype] sival_ptr
   kernel/trace/bpf_trace.c:835:41: sparse:     got void *
>> kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3633:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3647:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3654:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3662:52: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c:3670:56: sparse: sparse: cast removes address space '__user' of expression
   kernel/trace/bpf_trace.c: note: in included file (through include/linux/rbtree.h, include/linux/mm_types.h, include/linux/mmzone.h, ...):
   include/linux/rcupdate.h:871:25: sparse: sparse: context imbalance in 'uprobe_prog_run' - unexpected unlock

vim +/__user +3619 kernel/trace/bpf_trace.c

  3615	
  3616	__bpf_kfunc int bpf_probe_read_user_dynptr(struct bpf_dynptr *dptr, u32 off,
  3617						   u32 size, const void __user *unsafe_ptr__ign)
  3618	{
> 3619		return __bpf_dynptr_copy(dptr, off, size, (const void *)unsafe_ptr__ign,
  3620					 copy_user_data_nofault, NULL);
  3621	}
  3622	

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

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-01-13 16:59 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-01-13  9:17 kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes address space '__user' of expression kernel test robot
2026-01-13 16:58 ` Andrii Nakryiko
  -- strict thread matches above, loose matches on Subject: below --
2025-12-11  2:45 kernel test robot

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®