Re: [PATCH bpf-next 1/6] bpf: Support ->fill_link_info for kprobe_multi

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi Yafang,

kernel test robot noticed the following build warnings:

[auto build test WARNING on bpf-next/master]

url:    https://github.com/intel-lab-lkp/linux/commits/Yafang-Shao/bpf-Support-fill_link_info-for-kprobe_multi/20230602-165455
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20230602085239.91138-2-laoar.shao%40gmail.com
patch subject: [PATCH bpf-next 1/6] bpf: Support ->fill_link_info for kprobe_multi
config: i386-randconfig-s002-20230601 (https://download.01.org/0day-ci/archive/20230603/202306031438.0X2HPFQl-lkp@xxxxxxxxx/config)
compiler: gcc-12 (Debian 12.2.0-14) 12.2.0
reproduce:
        # apt-get install sparse
        # sparse version: v0.6.4-39-gce1a6720-dirty
        # https://github.com/intel-lab-lkp/linux/commit/270f3eb6c142f1f0ec7d800b8ecaab1b101682a0
        git remote add linux-review https://github.com/intel-lab-lkp/linux
        git fetch --no-tags linux-review Yafang-Shao/bpf-Support-fill_link_info-for-kprobe_multi/20230602-165455
        git checkout 270f3eb6c142f1f0ec7d800b8ecaab1b101682a0
        # save the config file
        mkdir build_dir && cp config build_dir/.config
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 olddefconfig
        make W=1 C=1 CF='-fdiagnostic-prefix -D__CHECK_ENDIAN__' O=build_dir ARCH=i386 SHELL=/bin/bash kernel/trace/

If you fix the issue, kindly add following tag where applicable
| Reported-by: kernel test robot <lkp@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202306031438.0X2HPFQl-lkp@xxxxxxxxx/

sparse warnings: (new ones prefixed by >>)
>> kernel/trace/bpf_trace.c:2554:24: sparse: sparse: cast removes address space '__user' of expression
>> kernel/trace/bpf_trace.c:2571:26: sparse: sparse: incorrect type in argument 1 (different address spaces) @@     expected void [noderef] __user *to @@     got unsigned long long [usertype] *uaddrs @@
   kernel/trace/bpf_trace.c:2571:26: sparse:     expected void [noderef] __user *to
   kernel/trace/bpf_trace.c:2571:26: sparse:     got unsigned long long [usertype] *uaddrs
   kernel/trace/bpf_trace.c:2492:21: sparse: sparse: dereference of noderef expression
   kernel/trace/bpf_trace.c:2496:66: sparse: sparse: dereference of noderef expression

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

  2550	
  2551	static int bpf_kprobe_multi_link_fill_link_info(const struct bpf_link *link,
  2552							struct bpf_link_info *info)
  2553	{
> 2554		u64 *uaddrs = (u64 *)u64_to_user_ptr(info->kprobe_multi.addrs);
  2555		struct bpf_kprobe_multi_link *kmulti_link;
  2556		u32 ucount = info->kprobe_multi.count;
  2557	
  2558		if (!uaddrs ^ !ucount)
  2559			return -EINVAL;
  2560	
  2561		kmulti_link = container_of(link, struct bpf_kprobe_multi_link, link);
  2562		if (!uaddrs) {
  2563			info->kprobe_multi.count = kmulti_link->cnt;
  2564			return 0;
  2565		}
  2566	
  2567		if (!ucount)
  2568			return 0;
  2569		if (ucount != kmulti_link->cnt)
  2570			return -EINVAL;
> 2571		if (copy_to_user(uaddrs, kmulti_link->addrs, ucount * sizeof(u64)))
  2572			return -EFAULT;
  2573		return 0;
  2574	}
  2575	

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




[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux