Re: [PATCH bpf-next 2/4] bpf: Add bpf command to get number of map entries

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

 



Hi Charalampos,

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/Charalampos-Stylianopoulos/bpf-Add-map_num_entries-map-op/20250106-225520
base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
patch link:    https://lore.kernel.org/r/20250106145328.399610-3-charalampos.stylianopoulos%40gmail.com
patch subject: [PATCH bpf-next 2/4] bpf: Add bpf command to get number of map entries
config: nios2-randconfig-r072-20250107 (https://download.01.org/0day-ci/archive/20250108/202501080123.MlvmZO4I-lkp@xxxxxxxxx/config)
compiler: nios2-linux-gcc (GCC) 14.2.0

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@xxxxxxxxx>
| Closes: https://lore.kernel.org/oe-kbuild-all/202501080123.MlvmZO4I-lkp@xxxxxxxxx/

New smatch warnings:
kernel/bpf/syscall.c:5771 bpf_get_num_entries() warn: unsigned 'num_entries' is never less than zero.

Old smatch warnings:
arch/nios2/include/asm/thread_info.h:62 current_thread_info() error: uninitialized symbol 'sp'.

vim +/num_entries +5771 kernel/bpf/syscall.c

  5752	
  5753	static int bpf_get_num_entries(union bpf_attr *attr, union bpf_attr __user *uattr)
  5754	{
  5755		__u32 num_entries = 0;
  5756		struct bpf_map *map;
  5757	
  5758		if (CHECK_ATTR(BPF_MAP_GET_NUM_ENTRIES))
  5759			return -EINVAL;
  5760	
  5761	
  5762		CLASS(fd, f)(attr->map_fd);
  5763		map = __bpf_map_get(f);
  5764		if (IS_ERR(map))
  5765			return PTR_ERR(map);
  5766	
  5767		if (!map->ops->map_num_entries)
  5768			return -EOPNOTSUPP;
  5769	
  5770		num_entries = map->ops->map_num_entries(map);
> 5771		if (num_entries < 0)
  5772			return num_entries;
  5773	
  5774		if (put_user(num_entries, &uattr->map_get_num_entries.num_entries))
  5775			return -EFAULT;
  5776	
  5777		return 0;
  5778	}
  5779	

-- 
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