File tree Expand file tree Collapse file tree 1 file changed +13
-0
lines changed
Expand file tree Collapse file tree 1 file changed +13
-0
lines changed Original file line number Diff line number Diff line change @@ -317,9 +317,22 @@ BTF_ID_FLAGS(func, bpf_mptcp_subflow_queues_empty)
317317BTF_ID_FLAGS (func , mptcp_pm_subflow_chk_stale , KF_SLEEPABLE )
318318BTF_KFUNCS_END (bpf_mptcp_common_kfunc_ids )
319319
320+ static int bpf_mptcp_common_kfunc_filter (const struct bpf_prog * prog , u32 kfunc_id )
321+ {
322+ if (!btf_id_set8_contains (& bpf_mptcp_common_kfunc_ids , kfunc_id ))
323+ return 0 ;
324+
325+ if (prog -> aux -> st_ops &&
326+ prog -> aux -> st_ops != & bpf_mptcp_sched_ops )
327+ return - EACCES ;
328+
329+ return 0 ;
330+ }
331+
320332static const struct btf_kfunc_id_set bpf_mptcp_common_kfunc_set = {
321333 .owner = THIS_MODULE ,
322334 .set = & bpf_mptcp_common_kfunc_ids ,
335+ .filter = bpf_mptcp_common_kfunc_filter ,
323336};
324337
325338static int __init bpf_mptcp_kfunc_init (void )
You can’t perform that action at this time.
0 commit comments