Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

Merge branch 'allow-calling-kfuncs-from-raw_tp-programs'

Puranjay Mohan says:

====================
Allow calling kfuncs from raw_tp programs

V1: https://lore.kernel.org/all/20251218145514.339819-1-puranjay@kernel.org/
Changes in V1->V2:
- Update selftests to allow success for raw_tp programs calling kfuncs.

This set enables calling kfuncs from raw_tp programs.
====================

Link: https://patch.msgid.link/20251222133250.1890587-1-puranjay@kernel.org
Signed-off-by: Alexei Starovoitov <ast@kernel.org>

+5 -4
+1
kernel/bpf/btf.c
··· 8681 8681 return BTF_KFUNC_HOOK_STRUCT_OPS; 8682 8682 case BPF_PROG_TYPE_TRACING: 8683 8683 case BPF_PROG_TYPE_TRACEPOINT: 8684 + case BPF_PROG_TYPE_RAW_TRACEPOINT: 8684 8685 case BPF_PROG_TYPE_PERF_EVENT: 8685 8686 case BPF_PROG_TYPE_LSM: 8686 8687 return BTF_KFUNC_HOOK_TRACING;
+1 -1
tools/testing/selftests/bpf/progs/dynptr_fail.c
··· 1465 1465 } 1466 1466 1467 1467 /* Only supported prog type can create skb-type dynptrs */ 1468 - SEC("?raw_tp") 1468 + SEC("?xdp") 1469 1469 __failure __msg("calling kernel function bpf_dynptr_from_skb is not allowed") 1470 1470 int skb_invalid_ctx(void *ctx) 1471 1471 {
+3 -3
tools/testing/selftests/bpf/progs/verifier_kfunc_prog_types.c
··· 32 32 } 33 33 34 34 SEC("raw_tp") 35 - __failure __msg("calling kernel function") 35 + __success 36 36 int BPF_PROG(task_kfunc_raw_tp) 37 37 { 38 38 task_kfunc_load_test(); ··· 86 86 } 87 87 88 88 SEC("raw_tp") 89 - __failure __msg("calling kernel function") 89 + __success 90 90 int BPF_PROG(cgrp_kfunc_raw_tp) 91 91 { 92 92 cgrp_kfunc_load_test(); ··· 138 138 } 139 139 140 140 SEC("raw_tp") 141 - __failure __msg("calling kernel function") 141 + __success 142 142 int BPF_PROG(cpumask_kfunc_raw_tp) 143 143 { 144 144 cpumask_kfunc_load_test();