aboutsummaryrefslogtreecommitdiff
path: root/tools/perf/scripts/python/export-to-sqlite.py
diff options
context:
space:
mode:
authorShung-Hsi Yu <[email protected]>2023-11-02 13:39:03 +0800
committerAlexei Starovoitov <[email protected]>2023-11-01 22:54:27 -0700
commit291d044fd51f8484066300ee42afecf8c8db7b3a (patch)
treec89109320ecb69c5eea9fdb3cd4580dbf031ddae /tools/perf/scripts/python/export-to-sqlite.py
parent698b8c5e3b5505ac00102caf9e4843b71192b586 (diff)
bpf: Fix precision tracking for BPF_ALU | BPF_TO_BE | BPF_END
BPF_END and BPF_NEG has a different specification for the source bit in the opcode compared to other ALU/ALU64 instructions, and is either reserved or use to specify the byte swap endianness. In both cases the source bit does not encode source operand location, and src_reg is a reserved field. backtrack_insn() currently does not differentiate BPF_END and BPF_NEG from other ALU/ALU64 instructions, which leads to r0 being incorrectly marked as precise when processing BPF_ALU | BPF_TO_BE | BPF_END instructions. This commit teaches backtrack_insn() to correctly mark precision for such case. While precise tracking of BPF_NEG and other BPF_END instructions are correct and does not need fixing, this commit opt to process all BPF_NEG and BPF_END instructions within the same if-clause to better align with current convention used in the verifier (e.g. check_alu_op). Fixes: b5dc0163d8fd ("bpf: precise scalar_value tracking") Cc: [email protected] Reported-by: Mohamed Mahmoud <[email protected]> Closes: https://lore.kernel.org/r/[email protected] Tested-by: Toke Høiland-Jørgensen <[email protected]> Tested-by: Tao Lyu <[email protected]> Acked-by: Eduard Zingerman <[email protected]> Signed-off-by: Shung-Hsi Yu <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/perf/scripts/python/export-to-sqlite.py')
0 files changed, 0 insertions, 0 deletions