diff options
| author | Juntong Deng <[email protected]> | 2024-08-28 19:48:11 +0000 |
|---|---|---|
| committer | Alexei Starovoitov <[email protected]> | 2024-08-29 00:11:54 +0000 |
| commit | f633919d132cf1755d62278c989124c0ce23950f (patch) | |
| tree | b3b6c0ab0e1c140480f33b8d4218de072f6a06ab /tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c | |
| parent | selftests/bpf: Fix incorrect parameters in NULL pointer checking (diff) | |
| download | kernel-f633919d132cf1755d62278c989124c0ce23950f.tar.gz kernel-f633919d132cf1755d62278c989124c0ce23950f.zip | |
bpf: Relax KF_ACQUIRE kfuncs strict type matching constraint
Currently we cannot pass zero offset (implicit cast) or non-zero offset
pointers to KF_ACQUIRE kfuncs. This is because KF_ACQUIRE kfuncs
requires strict type matching, but zero offset or non-zero offset does
not change the type of pointer, which causes the ebpf program to be
rejected by the verifier.
This can cause some problems, one example is that bpf_skb_peek_tail
kfunc [0] cannot be implemented by just passing in non-zero offset
pointers. We cannot pass pointers like &sk->sk_write_queue (non-zero
offset) or &sk->__sk_common (zero offset) to KF_ACQUIRE kfuncs.
This patch makes KF_ACQUIRE kfuncs not require strict type matching.
[0]: https://lore.kernel.org/bpf/AM6PR03MB5848CA39CB4B7A4397D380B099B12@AM6PR03MB5848.eurprd03.prod.outlook.com/
Signed-off-by: Juntong Deng <[email protected]>
Link: https://lore.kernel.org/r/AM6PR03MB5848FD2BD89BF0B6B5AA3B4C99952@AM6PR03MB5848.eurprd03.prod.outlook.com
Signed-off-by: Alexei Starovoitov <[email protected]>
Diffstat (limited to 'tools/testing/selftests/bpf/bpf_testmod/bpf_testmod.c')
0 files changed, 0 insertions, 0 deletions
