Re: [PATCH bpf-next] bpf: fix static checker warning

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

 



On 11/27/19 12:01 AM, Alexei Starovoitov wrote:
kernel/bpf/btf.c:4023 btf_distill_func_proto()
         error: potentially dereferencing uninitialized 't'.

kernel/bpf/btf.c
   4012          nargs = btf_type_vlen(func);
   4013          if (nargs >= MAX_BPF_FUNC_ARGS) {
   4014                  bpf_log(log,
   4015                          "The function %s has %d arguments. Too many.\n",
   4016                          tname, nargs);
   4017                  return -EINVAL;
   4018          }
   4019          ret = __get_type_size(btf, func->type, &t);
                                                        ^^
t isn't initialized for the first -EINVAL return

This is unlikely path, since BTF should have been validated at this point.
Fix it by returning 'void' BTF.

Reported-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>
Signed-off-by: Alexei Starovoitov <ast@xxxxxxxxxx>

Applied, thanks!



[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