Re: [PATCH v4 bpf-next 3/8] bpf: add support for open-coded iterator loops

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

 



On Wed, Mar 8, 2023 at 8:35 PM Dan Carpenter <error27@xxxxxxxxx> wrote:
>
> Hi Andrii,
>
> url:    https://github.com/intel-lab-lkp/linux/commits/Andrii-Nakryiko/bpf-factor-out-fetching-basic-kfunc-metadata/20230308-115539
> base:   https://git.kernel.org/pub/scm/linux/kernel/git/bpf/bpf-next.git master
> patch link:    https://lore.kernel.org/r/20230308035416.2591326-4-andrii%40kernel.org
> patch subject: [PATCH v4 bpf-next 3/8] bpf: add support for open-coded iterator loops
> config: loongarch-randconfig-m041-20230305 (https://download.01.org/0day-ci/archive/20230309/202303090153.YeswNcW4-lkp@xxxxxxxxx/config)
> compiler: loongarch64-linux-gcc (GCC) 12.1.0
>
> If you fix the issue, kindly add following tag where applicable
> | Reported-by: kernel test robot <lkp@xxxxxxxxx>
> | Reported-by: Dan Carpenter <error27@xxxxxxxxx>
> | Link: https://lore.kernel.org/r/202303090153.YeswNcW4-lkp@xxxxxxxxx/
>
> smatch warnings:
> kernel/bpf/verifier.c:1244 is_iter_reg_valid_uninit() error: uninitialized symbol 'j'.
>
> vim +/j +1244 kernel/bpf/verifier.c
>
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1225  static bool is_iter_reg_valid_uninit(struct bpf_verifier_env *env,
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1226                                      struct bpf_reg_state *reg, int nr_slots)
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1227  {
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1228         struct bpf_func_state *state = func(env, reg);
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1229         int spi, i, j;
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1230
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1231         /* For -ERANGE (i.e. spi not falling into allocated stack slots), we
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1232          * will do check_mem_access to check and update stack bounds later, so
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1233          * return true for that case.
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1234          */
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1235         spi = iter_get_spi(env, reg, nr_slots);
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1236         if (spi == -ERANGE)
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1237                 return true;
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1238         if (spi < 0)
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1239                 return spi;
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1240
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1241         for (i = 0; i < nr_slots; i++) {
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1242                 struct bpf_stack_state *slot = &state->stack[spi - i];
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1243
> 8f263e1296a91f Andrii Nakryiko 2023-03-07 @1244                 if (slot->slot_type[j] == STACK_ITER)
>                                                                                     ^
> s/j/i/?
>

nope, I accidentally removed the inner for loop. I fixed all that in
v5, which was applied today. But thanks for the notification!

> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1245                         return false;
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1246         }
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1247
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1248         return true;
> 8f263e1296a91f Andrii Nakryiko 2023-03-07  1249  }
>
> --
> 0-DAY CI Kernel Test Service
> https://github.com/intel/lkp-tests
>




[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