diff options
author | 2025-01-14 13:28:44 -0700 | |
---|---|---|
committer | 2025-01-16 17:51:10 -0800 | |
commit | 37cce22dbd51a3ef7f6c08c3fb5f1c5075a17fbb (patch) | |
tree | 1a0a9958409ee4c9111c32ab6ea6c41b824692b3 /net/lapb/lapb_timer.c | |
parent | bpf: tcp: Mark bpf_load_hdr_opt() arg2 as read-write (diff) | |
download | wireguard-linux-37cce22dbd51a3ef7f6c08c3fb5f1c5075a17fbb.tar.xz wireguard-linux-37cce22dbd51a3ef7f6c08c3fb5f1c5075a17fbb.zip |
bpf: verifier: Refactor helper access type tracking
Previously, the verifier was treating all PTR_TO_STACK registers passed
to a helper call as potentially written to by the helper. However, all
calls to check_stack_range_initialized() already have precise access type
information available.
Rather than treat ACCESS_HELPER as a proxy for BPF_WRITE, pass
enum bpf_access_type to check_stack_range_initialized() to more
precisely track helper arguments.
One benefit from this precision is that registers tracked as valid
spills and passed as a read-only helper argument remain tracked after
the call. Rather than being marked STACK_MISC afterwards.
An additional benefit is the verifier logs are also more precise. For
this particular error, users will enjoy a slightly clearer message. See
included selftest updates for examples.
Acked-by: Eduard Zingerman <eddyz87@gmail.com>
Signed-off-by: Daniel Xu <dxu@dxuuu.xyz>
Link: https://lore.kernel.org/r/ff885c0e5859e0cd12077c3148ff0754cad4f7ed.1736886479.git.dxu@dxuuu.xyz
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Diffstat (limited to 'net/lapb/lapb_timer.c')
0 files changed, 0 insertions, 0 deletions