[bug report] bpf: Introduce BPF trampoline

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

 



Hello Alexei Starovoitov,

The patch fec56f5890d9: "bpf: Introduce BPF trampoline" from Nov 14,
2019, leads to the following static checker warning:

	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

  4020          if (ret < 0) {
  4021                  bpf_log(log,
  4022                          "The function %s return type %s is unsupported.\n",
  4023                          tname, btf_kind_str[BTF_INFO_KIND(t->info)]);
                                                                  ^^^^^^^
  4024                  return -EINVAL;
  4025          }
  4026          m->ret_size = ret;

See also:
kernel/bpf/btf.c:4033 btf_distill_func_proto() error: potentially dereferencing uninitialized 't'.

regards,
dan carpenter



[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