-
Notifications
You must be signed in to change notification settings - Fork 5
Use correct destructor kfunc types #6426
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: bpf-next_base
Are you sure you want to change the base?
Use correct destructor kfunc types #6426
Conversation
|
Upstream branch: 688b745 |
8c83cb5 to
f015201
Compare
|
Upstream branch: 19f4091 |
8c8508c to
7e54e3f
Compare
f015201 to
884c5bc
Compare
|
Upstream branch: bd5bdd2 |
7e54e3f to
1f589f6
Compare
884c5bc to
4355736
Compare
|
Upstream branch: 34235a3 |
1f589f6 to
e78798f
Compare
4355736 to
5bece43
Compare
|
Upstream branch: c1af446 |
e78798f to
f9162b5
Compare
5bece43 to
52f5a27
Compare
|
Upstream branch: ff34657 |
f9162b5 to
739b773
Compare
52f5a27 to
037d2fc
Compare
|
Upstream branch: ff34657 |
739b773 to
1bc7fe2
Compare
037d2fc to
8f722b4
Compare
|
Upstream branch: 8f7aa3d |
1bc7fe2 to
4b98528
Compare
8f722b4 to
03e2ed2
Compare
|
Upstream branch: 835a507 |
4b98528 to
f67ae56
Compare
03e2ed2 to
3ea267d
Compare
3ea267d to
6d4eb64
Compare
|
Upstream branch: 835a507 |
283b3f8 to
93314fa
Compare
6d4eb64 to
af4bac7
Compare
|
Upstream branch: 81f88f6 |
93314fa to
eed7e94
Compare
af4bac7 to
6ba2fc1
Compare
|
Upstream branch: 5d9fb42 |
eed7e94 to
3fc7fa6
Compare
6ba2fc1 to
362a95a
Compare
|
Upstream branch: 5d9fb42 |
3fc7fa6 to
23ee967
Compare
362a95a to
9671fbe
Compare
|
Upstream branch: c93c124 |
23ee967 to
a92cb82
Compare
9671fbe to
dad8a9c
Compare
With CONFIG_CFI enabled, the kernel strictly enforces that indirect
function calls use a function pointer type that matches the target
function. I ran into the following type mismatch when running BPF
self-tests:
CFI failure at bpf_obj_free_fields+0x190/0x238 (target:
bpf_crypto_ctx_release+0x0/0x94; expected type: 0xa488ebfc)
Internal error: Oops - CFI: 00000000f2008228 [#1] SMP
...
As bpf_crypto_ctx_release() is also used in BPF programs and using
a void pointer as the argument would make the verifier unhappy, add
a simple stub function with the correct type and register it as the
destructor kfunc instead.
Signed-off-by: Sami Tolvanen <samitolvanen@google.com>
Acked-by: Yonghong Song <yonghong.song@linux.dev>
Tested-by: Viktor Malik <vmalik@redhat.com>
With CONFIG_CFI enabled, the kernel strictly enforces that indirect function calls use a function pointer type that matches the target function. As bpf_kfree_skb() signature differs from the btf_dtor_kfunc_t pointer type used for the destructor calls in bpf_obj_free_fields(), add a stub function with the correct type to fix the type mismatch. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Acked-by: Yonghong Song <yonghong.song@linux.dev>
With CONFIG_CFI enabled, the kernel strictly enforces that indirect function calls use a function pointer type that matches the target function. As bpf_testmod_ctx_release() signature differs from the btf_dtor_kfunc_t pointer type used for the destructor calls in bpf_obj_free_fields(), add a stub function with the correct type to fix the type mismatch. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Acked-by: Yonghong Song <yonghong.song@linux.dev>
|
Upstream branch: 759377d |
Ensure that registered destructor kfuncs have the same type as btf_dtor_kfunc_t to avoid a kernel panic on systems with CONFIG_CFI enabled. Signed-off-by: Sami Tolvanen <samitolvanen@google.com> Acked-by: Yonghong Song <yonghong.song@linux.dev>
a92cb82 to
a3eee66
Compare
2b47d31 to
abf45ae
Compare
74af854 to
5cc3146
Compare
Pull request for series with
subject: Use correct destructor kfunc types
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1028057