bafac36805
BugLink: https://bugs.launchpad.net/bugs/2085849 [ Upstream commit bacc15e010fc5a235fb2020b06a29a9961b5db82 ] The module does not do anything when the JIT is disabled, but instead causes a warning: In file included from include/linux/bpf_verifier.h:7, from drivers/hid/bpf/hid_bpf_struct_ops.c:10: drivers/hid/bpf/hid_bpf_struct_ops.c: In function 'hid_bpf_struct_ops_init': include/linux/bpf.h:1853:50: error: statement with no effect [-Werror=unused-value] 1853 | #define register_bpf_struct_ops(st_ops, type) ({ (void *)(st_ops); 0; }) | ^~~~~~~~~~~~~~~~ drivers/hid/bpf/hid_bpf_struct_ops.c:305:16: note: in expansion of macro 'register_bpf_struct_ops' 305 | return register_bpf_struct_ops(&bpf_hid_bpf_ops, hid_bpf_ops); | ^~~~~~~~~~~~~~~~~~~~~~~ Add a Kconfig dependency to only allow building the HID-BPF support when a JIT is enabled. Fixes: ebc0d8093e8c ("HID: bpf: implement HID-BPF through bpf_struct_ops") Signed-off-by: Arnd Bergmann <arnd@arndb.de> Link: https://patch.msgid.link/96a00b6f-eb81-4c67-8c4b-6b1f3f045034@app.fastmail.com Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> Signed-off-by: Sasha Levin <sashal@kernel.org> Signed-off-by: Manuel Diewald <manuel.diewald@canonical.com> Signed-off-by: Roxana Nicolescu <roxana.nicolescu@canonical.com>
17 lines
441 B
Plaintext
17 lines
441 B
Plaintext
# SPDX-License-Identifier: GPL-2.0-only
|
|
menu "HID-BPF support"
|
|
|
|
config HID_BPF
|
|
bool "HID-BPF support"
|
|
depends on BPF_JIT
|
|
depends on BPF_SYSCALL
|
|
depends on DYNAMIC_FTRACE_WITH_DIRECT_CALLS
|
|
help
|
|
This option allows to support eBPF programs on the HID subsystem.
|
|
eBPF programs can fix HID devices in a lighter way than a full
|
|
kernel patch and allow a lot more flexibility.
|
|
|
|
For documentation, see Documentation/hid/hid-bpf.rst
|
|
|
|
endmenu
|