-
Notifications
You must be signed in to change notification settings - Fork 152
Use correct destructor kfunc types #10379
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?
Conversation
|
Upstream branch: 688b745 |
233a075 to
fbe4d04
Compare
|
Upstream branch: bd5bdd2 |
e506329 to
53bcc90
Compare
fbe4d04 to
6abef8e
Compare
|
Upstream branch: 34235a3 |
53bcc90 to
38986af
Compare
6abef8e to
2751ec7
Compare
|
Upstream branch: 85bdeeb |
38986af to
d3e96af
Compare
2751ec7 to
886a6a6
Compare
|
Upstream branch: ff34657 |
d3e96af to
367b161
Compare
886a6a6 to
4eeea58
Compare
|
Upstream branch: ff34657 |
367b161 to
fc6f7a7
Compare
4eeea58 to
a9395d7
Compare
|
Upstream branch: 8f7aa3d |
fc6f7a7 to
83dce67
Compare
a9395d7 to
c320ac6
Compare
|
Upstream branch: 835a507 |
83dce67 to
0e8dba9
Compare
c320ac6 to
d24fc80
Compare
|
Upstream branch: 835a507 |
0e8dba9 to
da28fb1
Compare
d24fc80 to
155b58a
Compare
|
Upstream branch: 835a507 |
da28fb1 to
10f2657
Compare
155b58a to
942f7c3
Compare
|
Upstream branch: 81f88f6 |
10f2657 to
9f470a9
Compare
942f7c3 to
caaaee4
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>
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>
|
Upstream branch: 5d9fb42 |
9f470a9 to
33d6bd7
Compare
Pull request for series with
subject: Use correct destructor kfunc types
version: 4
url: https://patchwork.kernel.org/project/netdevbpf/list/?series=1028057