lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <CAEf4BzbSNo2MR9i-=_5tk3PV_QofSZM7_+0Ek7rqP3VjVt9e4Q@mail.gmail.com>
Date: Tue, 13 Jan 2026 08:58:52 -0800
From: Andrii Nakryiko <andrii.nakryiko@...il.com>
To: kernel test robot <lkp@...el.com>
Cc: Mykyta Yatsenko <yatsenko@...a.com>, oe-kbuild-all@...ts.linux.dev, 
	linux-kernel@...r.kernel.org, Alexei Starovoitov <ast@...nel.org>, 
	Andrii Nakryiko <andrii@...nel.org>
Subject: Re: kernel/trace/bpf_trace.c:3619:52: sparse: sparse: cast removes
 address space '__user' of expression

On Tue, Jan 13, 2026 at 1:17 AM kernel test robot <lkp@...el.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@...el.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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ