Skip to content

Commit acd5f76

Browse files
Benjamin TissoiresJiri Kosina
Benjamin Tissoires
authored and
Jiri Kosina
committed
HID: bpf: fix cfi stubs for hid_bpf_ops
With the introduction of commit e42ac14 ("bpf: Check unsupported ops from the bpf_struct_ops's cfi_stubs"), a HID-BPF struct_ops containing a .hid_hw_request() or a .hid_hw_output_report() was failing to load as the cfi stubs were not defined. Fix that by defining those simple static functions and restore HID-BPF functionality. This was detected with the HID selftests suddenly failing on Linus' tree. Cc: [email protected] # v6.11+ Fixes: 9286675 ("HID: bpf: add HID-BPF hooks for hid_hw_output_report") Fixes: 8bd0488 ("HID: bpf: add HID-BPF hooks for hid_hw_raw_requests") Signed-off-by: Benjamin Tissoires <[email protected]> Signed-off-by: Jiri Kosina <[email protected]>
1 parent 1ee68f1 commit acd5f76

File tree

1 file changed

+14
-0
lines changed

1 file changed

+14
-0
lines changed

drivers/hid/bpf/hid_bpf_struct_ops.c

+14
Original file line numberDiff line numberDiff line change
@@ -276,9 +276,23 @@ static int __hid_bpf_rdesc_fixup(struct hid_bpf_ctx *ctx)
276276
return 0;
277277
}
278278

279+
static int __hid_bpf_hw_request(struct hid_bpf_ctx *ctx, unsigned char reportnum,
280+
enum hid_report_type rtype, enum hid_class_request reqtype,
281+
u64 source)
282+
{
283+
return 0;
284+
}
285+
286+
static int __hid_bpf_hw_output_report(struct hid_bpf_ctx *ctx, u64 source)
287+
{
288+
return 0;
289+
}
290+
279291
static struct hid_bpf_ops __bpf_hid_bpf_ops = {
280292
.hid_device_event = __hid_bpf_device_event,
281293
.hid_rdesc_fixup = __hid_bpf_rdesc_fixup,
294+
.hid_hw_request = __hid_bpf_hw_request,
295+
.hid_hw_output_report = __hid_bpf_hw_output_report,
282296
};
283297

284298
static struct bpf_struct_ops bpf_hid_bpf_ops = {

0 commit comments

Comments
 (0)