@@ -44,7 +44,6 @@ __weak noinline int hid_bpf_device_event(struct hid_bpf_ctx *ctx)
44
44
{
45
45
return 0 ;
46
46
}
47
- ALLOW_ERROR_INJECTION (hid_bpf_device_event , ERRNO );
48
47
49
48
u8 *
50
49
dispatch_hid_bpf_device_event (struct hid_device * hdev , enum hid_report_type type , u8 * data ,
@@ -105,7 +104,6 @@ __weak noinline int hid_bpf_rdesc_fixup(struct hid_bpf_ctx *ctx)
105
104
{
106
105
return 0 ;
107
106
}
108
- ALLOW_ERROR_INJECTION (hid_bpf_rdesc_fixup , ERRNO );
109
107
110
108
u8 * call_hid_bpf_rdesc_fixup (struct hid_device * hdev , u8 * rdesc , unsigned int * size )
111
109
{
@@ -429,6 +427,18 @@ hid_bpf_hw_request(struct hid_bpf_ctx *ctx, __u8 *buf, size_t buf__sz,
429
427
return ret ;
430
428
}
431
429
430
+ /* our HID-BPF entrypoints */
431
+ BTF_SET8_START (hid_bpf_fmodret_ids )
432
+ BTF_ID_FLAGS (func , hid_bpf_device_event )
433
+ BTF_ID_FLAGS (func , hid_bpf_rdesc_fixup )
434
+ BTF_ID_FLAGS (func , __hid_bpf_tail_call )
435
+ BTF_SET8_END (hid_bpf_fmodret_ids )
436
+
437
+ static const struct btf_kfunc_id_set hid_bpf_fmodret_set = {
438
+ .owner = THIS_MODULE ,
439
+ .set = & hid_bpf_fmodret_ids ,
440
+ };
441
+
432
442
/* for syscall HID-BPF */
433
443
BTF_SET8_START (hid_bpf_syscall_kfunc_ids )
434
444
BTF_ID_FLAGS (func , hid_bpf_attach_prog )
@@ -495,6 +505,12 @@ static int __init hid_bpf_init(void)
495
505
* will not be available, so nobody will be able to use the functionality.
496
506
*/
497
507
508
+ err = register_btf_fmodret_id_set (& hid_bpf_fmodret_set );
509
+ if (err ) {
510
+ pr_warn ("error while registering fmodret entrypoints: %d" , err );
511
+ return 0 ;
512
+ }
513
+
498
514
err = register_btf_kfunc_id_set (BPF_PROG_TYPE_TRACING , & hid_bpf_kfunc_set );
499
515
if (err ) {
500
516
pr_warn ("error while setting HID BPF tracing kfuncs: %d" , err );
0 commit comments