]> www.infradead.org Git - users/jedix/linux-maple.git/commit
selftests/hid: add tests for hid_hw_output_report HID-BPF hooks
authorBenjamin Tissoires <bentiss@kernel.org>
Wed, 26 Jun 2024 13:46:29 +0000 (15:46 +0200)
committerBenjamin Tissoires <bentiss@kernel.org>
Thu, 27 Jun 2024 09:00:48 +0000 (11:00 +0200)
commit3ac83fcd6e67c86d25040e6818972f2c36b51d23
treed87be489e8b112eab85ead9ca28cd04df31fad3c
parent9286675a2aed40a517be8cc4e283a04f473275b5
selftests/hid: add tests for hid_hw_output_report HID-BPF hooks

We add 3 new tests:
- first, we make sure we can prevent the output_report to happen
- second, we make sure that we can detect that a given hidraw client
  was actually doing the request, and for that client only, call ourself
  hid_bpf_hw_output_report(), returning a custom value
- last, we ensure that we can not loop between hooks for
  hid_hw_output_report() and manual calls to hid_bpf_hw_output_report()
  from that same hook

Link: https://patch.msgid.link/20240626-hid_hw_req_bpf-v2-8-cfd60fb6c79f@kernel.org
Acked-by: Jiri Kosina <jkosina@suse.com>
Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
drivers/hid/bpf/hid_bpf_dispatch.c
tools/testing/selftests/hid/hid_bpf.c
tools/testing/selftests/hid/progs/hid.c