[PATCH bpf-next] bpf: Add __bpfcall attribute to bpf_task_work_callback()
From: Heiko Carstens
Date: Mon Jul 27 2026 - 05:42:11 EST
BPF kCFI support is optional for architectures which support kCFI.
If an architecture provides bpf kCFI support it must override the
default __bpfcall define (which translates to __nocfi).
Add the missing __bpfcall attribute to bpf_task_work_callback() which
calls bpf programs indirectly to avoid CFI checks for such cases.
Fixes: 38aa7003e369 ("bpf: task work scheduling kfuncs")
Signed-off-by: Heiko Carstens <hca@xxxxxxxxxxxxx>
---
kernel/bpf/helpers.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/kernel/bpf/helpers.c b/kernel/bpf/helpers.c
index 88b38db47de9..9bf82c9ea1da 100644
--- a/kernel/bpf/helpers.c
+++ b/kernel/bpf/helpers.c
@@ -4447,7 +4447,7 @@ static void bpf_task_work_cancel(struct bpf_task_work_ctx *ctx)
bpf_task_work_ctx_put(ctx);
}
-static void bpf_task_work_callback(struct callback_head *cb)
+static __bpfcall void bpf_task_work_callback(struct callback_head *cb)
{
struct bpf_task_work_ctx *ctx = container_of(cb, struct bpf_task_work_ctx, work);
enum bpf_task_work_state state;
--
2.53.0