linux-stable/tools
Yonghong Song c49a44b39b libbpf: Fix an unsigned < 0 bug
Andrii reported a bug with the following information:

  2859 	if (enum64_placeholder_id == 0) {
  2860 		enum64_placeholder_id = btf__add_int(btf, "enum64_placeholder", 1, 0);
  >>>     CID 394804:  Control flow issues  (NO_EFFECT)
  >>>     This less-than-zero comparison of an unsigned value is never true. "enum64_placeholder_id < 0U".
  2861 		if (enum64_placeholder_id < 0)
  2862 			return enum64_placeholder_id;
  2863    	...

Here enum64_placeholder_id declared as '__u32' so enum64_placeholder_id < 0
is always false. Declare enum64_placeholder_id as 'int' in order to capture
the potential error properly.

Fixes: f2a625889b ("libbpf: Add enum64 sanitization")
Reported-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Yonghong Song <yhs@fb.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20220613054314.1251905-1-yhs@fb.com
2022-06-14 17:01:54 +02:00
..
accounting taskstats: version 12 with thread group and exe info 2022-04-29 14:38:03 -07:00
arch perf tools changes for v5.19: 2nd batch 2022-05-29 10:10:15 -07:00
bootconfig
bpf bpftool: Fix bootstrapping during a cross compilation 2022-06-09 14:01:21 +02:00
build perf build: Stop using __weak bpf_map_create() to handle older libbpf versions 2022-05-26 12:36:56 -03:00
certs tools/certs: Add print-cert-tbs-hash.sh 2022-05-23 18:47:49 +03:00
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include bpf: Add btf enum64 support 2022-06-07 10:20:42 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix an unsigned < 0 bug 2022-06-14 17:01:54 +02:00
memory-model tools/memory-model/README: Update klitmus7 compat table 2022-05-03 10:12:48 -07:00
objtool Kbuild updates for v5.19 2022-05-26 12:09:50 -07:00
pci
pcmcia
perf perf scripts python: Support Arm CoreSight trace data disassembly 2022-05-27 13:22:14 -03:00
power Power management updates for 5.19-rc1 2022-05-24 16:04:25 -07:00
rcu
scripts
spi
testing selftest/bpf/benchs: Add bpf_map benchmark 2022-06-11 14:25:35 -07:00
thermal tools/thermal: remove unneeded semicolon 2022-05-19 12:11:52 +02:00
time
tracing rtla: Remove procps-ng dependency 2022-05-26 15:20:46 -04:00
usb
virtio
vm mm/page-flags: reuse PG_mappedtodisk as PG_anon_exclusive for PageAnon() pages 2022-05-09 18:20:44 -07:00
wmi
Makefile Thermal control updates for 5.19-rc1 2022-05-24 16:19:30 -07:00