9acbb7ba45
This is the same logic than hid_hw_raw_request or hid_hw_output_report: we can allow hid_bpf_try_input_report to be called from a hook on hid_input_report if we ensure that the call can not be made twice in a row. There is one extra subtlety in which there is a lock in hid_input_report. But given that we can detect if we are already in the hook, we can notify hid_input_report to not take the lock. This is done by checking if ctx_kern data is valid or null, and if it is equal to the dedicated incoming data buffer. In order to have more control on whether the lock needs to be taken or not we introduce a new kfunc for it: hid_bpf_try_input_report() Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-11-cfd60fb6c79f@kernel.org Acked-by: Jiri Kosina <jkosina@suse.com> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org> |
||
---|---|---|
.. | ||
amd-sfh-hid.rst | ||
hid-alps.rst | ||
hid-bpf.rst | ||
hid-sensor.rst | ||
hid-transport.rst | ||
hiddev.rst | ||
hidintro.rst | ||
hidraw.rst | ||
hidreport-parsing.rst | ||
index.rst | ||
intel-ish-hid.rst | ||
uhid.rst |