Bug 218320

Summary: HID-BPF fails to initialise, EINVAL
Product: Linux Reporter: Chris Rankin (rankincj)
Component: KernelAssignee: Virtual assignee for kernel bugs (linux-kernel)
Status: NEW ---    
Severity: normal    
Priority: P3    
Hardware: All   
OS: Linux   
Kernel Version: 6.6.8 Subsystem: hid-bpf
Regression: No Bisected commit-id:
Attachments: Kernel config for 6.6.8

Description Chris Rankin 2023-12-25 23:29:22 UTC
Created attachment 305655 [details]
Kernel config for 6.6.8

Trying to configure a 6.6.8 kernel to use HID-BPF, but it fails to initialise:

[    3.210054] hid_bpf: error while preloading HID BPF dispatcher: -22

The issue appears to relate to entrypoints_bpf__load(), specifically the "run" stage of bpf_load_and_run().

This is almost certainly a configuration issue, and so I have attached my kernel config. I suspect that hid-bpf has a missing extra dependency beyond CONFIG_DYNAMIC_FTRACE_WITH_DIRECT_CALLS=y.
Comment 1 Chris Rankin 2023-12-28 00:10:25 UTC
FWIW I have discovered that my kernel was missing CONFIG_DEBUG_INFO_BTF, and I also hadn't installed the pahole tool on my build machine. Perhaps the Kconfig rules need updating?