diff options
author | Eduard Zingerman <[email protected]> | 2024-08-22 01:41:09 -0700 |
---|---|---|
committer | Alexei Starovoitov <[email protected]> | 2024-08-22 08:35:21 -0700 |
commit | b2ee6d27e9c6be0409e96591dcee62032a8e0156 (patch) | |
tree | e86dafc183ed9f30a16296f3c2eddd7e9f6bb896 /lib/test_fortify/write_overflow-strncpy-src.c | |
parent | adec67d372fecd97585d76dbebb610d62ec9d2cc (diff) |
bpf: support bpf_fastcall patterns for kfuncs
Recognize bpf_fastcall patterns around kfunc calls.
For example, suppose bpf_cast_to_kern_ctx() follows bpf_fastcall
contract (which it does), in such a case allow verifier to rewrite BPF
program below:
r2 = 1;
*(u64 *)(r10 - 32) = r2;
call %[bpf_cast_to_kern_ctx];
r2 = *(u64 *)(r10 - 32);
r0 = r2;
By removing the spill/fill pair:
r2 = 1;
call %[bpf_cast_to_kern_ctx];
r0 = r2;
Acked-by: Yonghong Song <[email protected]>
Signed-off-by: Eduard Zingerman <[email protected]>
Link: https://lore.kernel.org/r/[email protected]
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'lib/test_fortify/write_overflow-strncpy-src.c')
0 files changed, 0 insertions, 0 deletions