WSL2-Linux-Kernel/tools
Andrii Nakryiko c50c0b57a5 bpf: fix mark_all_scalars_precise use in mark_chain_precision
When precision backtracking bails out due to some unsupported sequence
of instructions (e.g., stack access through register other than r10), we
need to mark all SCALAR registers as precise to be safe. Currently,
though, we mark SCALARs precise only starting from the state we detected
unsupported condition, which could be one of the parent states of the
actual current state. This will leave some registers potentially not
marked as precise, even though they should. So make sure we start
marking scalars as precise from current state (env->cur_state).

Further, we don't currently detect a situation when we end up with some
stack slots marked as needing precision, but we ran out of available
states to find the instructions that populate those stack slots. This is
akin the `i >= func->allocated_stack / BPF_REG_SIZE` check and should be
handled similarly by falling back to marking all SCALARs precise. Add
this check when we run out of states.

Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Link: https://lore.kernel.org/r/20230505043317.3629845-8-andrii@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
2023-05-04 22:35:35 -07:00
..
accounting
arch Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
bootconfig bootconfig: Fix testcase to increase max node 2023-03-22 01:00:28 +09:00
bpf bpftool: Dump map id instead of value for map_of_maps types 2023-04-27 13:26:34 -07:00
build
certs
cgroup
counter
debugging
edid
firewire
firmware
gpio
hv
iio
include Networking changes for 6.4. 2023-04-26 16:07:23 -07:00
io_uring
kvm/kvm_stat
laptop
leds
lib libbpf: Fix comment about arc and riscv arch in bpf_tracing.h 2023-05-04 17:11:04 -07:00
memory-model LKMM scripting updates for v6.4 2023-04-24 12:02:25 -07:00
mm slab changes for 6.4 2023-04-25 13:00:41 -07:00
net/ynl tools: ynl: Rename ethtool to ethtool.py 2023-04-13 22:18:29 -07:00
objtool for-6.4-tag 2023-04-26 09:13:44 -07:00
pci
pcmcia
perf perf tools fixes for v6.3: 2023-03-10 08:18:46 -08:00
power Power management updates for 6.4-rc1 2023-04-25 18:44:10 -07:00
rcu tools: rcu: Add usage function and check for argument 2023-03-11 18:10:17 -08:00
scripts Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2023-03-09 22:22:11 -08:00
spi
testing bpf: fix mark_all_scalars_precise use in mark_chain_precision 2023-05-04 22:35:35 -07:00
thermal
time
tracing tracing updates for 6.3: 2023-02-23 10:20:49 -08:00
usb
verification
virtio tools/virtio: fix typo in README instructions 2023-04-04 11:01:58 -04:00
wmi
Makefile tools/Makefile: do missed s/vm/mm/ 2023-04-18 14:22:12 -07:00