aboutsummaryrefslogtreecommitdiff
path: root/scripts/gdb/linux/vmalloc.py
diff options
context:
space:
mode:
authorAndrii Nakryiko <[email protected]>2024-02-12 15:32:20 -0800
committerAlexei Starovoitov <[email protected]>2024-02-13 18:46:47 -0800
commit879bbe7aa4afa80acf72a1cad7f52416ea78c52d (patch)
tree7167d3b75c871d1ba5001c27c13a751e2f0b77a8 /scripts/gdb/linux/vmalloc.py
parent824c58fb1090ae5e502284400682e30841280a87 (diff)
bpf: don't infer PTR_TO_CTX for programs with unnamed context type
For program types that don't have named context type name (e.g., BPF iterator programs or tracepoint programs), ctx_tname will be a non-NULL empty string. For such programs it shouldn't be possible to have PTR_TO_CTX argument for global subprogs based on type name alone. arg:ctx tag is the only way to have PTR_TO_CTX passed into global subprog for such program types. Fix this loophole, which currently would assume PTR_TO_CTX whenever user uses a pointer to anonymous struct as an argument to their global subprogs. This happens in practice with the following (quite common, in practice) approach: typedef struct { /* anonymous */ int x; } my_type_t; int my_subprog(my_type_t *arg) { ... } User's intent is to have PTR_TO_MEM argument for `arg`, but verifier will complain about expecting PTR_TO_CTX. This fix also closes unintended s390x-specific KPROBE handling of PTR_TO_CTX case. Selftest change is necessary to accommodate this. Fixes: 91cc1a99740e ("bpf: Annotate context types") Signed-off-by: Andrii Nakryiko <[email protected]> Link: https://lore.kernel.org/r/[email protected] Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'scripts/gdb/linux/vmalloc.py')
0 files changed, 0 insertions, 0 deletions