[PATCH HID 0/4] HID: selftest fixes after merge into 6.11-rc0 tree

Benjamin Tissoires posted 4 patches 1 month, 2 weeks ago
drivers/hid/bpf/hid_bpf_struct_ops.c               |  5 +++++
tools/testing/selftests/hid/hid_bpf.c              | 26 ++++++++++++++++++++++
tools/testing/selftests/hid/progs/hid.c            |  2 +-
.../testing/selftests/hid/progs/hid_bpf_helpers.h  |  2 +-
4 files changed, 33 insertions(+), 2 deletions(-)
[PATCH HID 0/4] HID: selftest fixes after merge into 6.11-rc0 tree
Posted by Benjamin Tissoires 1 month, 2 weeks ago
After HID-BPF struct_ops was merged into 6.11-rc0, there are a few
mishaps:
- the bpf_wq API changed and needs to be updated here
- libbpf now auto-attach all the struct_ops it sees in the bpf object,
  leading to attempting at attaching them multiple times

Fix the selftests but also prevent the same struct_ops to be attached
more than once as this enters various locks, confusions, and kernel
oopses.

Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
---
Benjamin Tissoires (4):
      selftests/hid: fix bpf_wq new API
      selftests/hid: disable struct_ops auto-attach
      HID: bpf: prevent the same struct_ops to be attached more than once
      selftests/hid: add test for attaching multiple time the same struct_ops

 drivers/hid/bpf/hid_bpf_struct_ops.c               |  5 +++++
 tools/testing/selftests/hid/hid_bpf.c              | 26 ++++++++++++++++++++++
 tools/testing/selftests/hid/progs/hid.c            |  2 +-
 .../testing/selftests/hid/progs/hid_bpf_helpers.h  |  2 +-
 4 files changed, 33 insertions(+), 2 deletions(-)
---
base-commit: 6e504d2c61244a01226c5100c835e44fb9b85ca8
change-id: 20240723-fix-6-11-bpf-cfa63dcda5bc

Best regards,
-- 
Benjamin Tissoires <bentiss@kernel.org>
Re: [PATCH HID 0/4] HID: selftest fixes after merge into 6.11-rc0 tree
Posted by Jiri Kosina 1 month, 2 weeks ago
On Tue, 23 Jul 2024, Benjamin Tissoires wrote:

> After HID-BPF struct_ops was merged into 6.11-rc0, there are a few
> mishaps:
> - the bpf_wq API changed and needs to be updated here
> - libbpf now auto-attach all the struct_ops it sees in the bpf object,
>   leading to attempting at attaching them multiple times
> 
> Fix the selftests but also prevent the same struct_ops to be attached
> more than once as this enters various locks, confusions, and kernel
> oopses.
> 
> Signed-off-by: Benjamin Tissoires <bentiss@kernel.org>
> ---
> Benjamin Tissoires (4):
>       selftests/hid: fix bpf_wq new API
>       selftests/hid: disable struct_ops auto-attach
>       HID: bpf: prevent the same struct_ops to be attached more than once
>       selftests/hid: add test for attaching multiple time the same struct_ops

Benjamin,

for the series

	Acked-by: Jiri Kosina <jkosina@suse.com>

Let's get this fixed ASAP. Thanks,

-- 
Jiri Kosina
SUSE Labs
Re: [PATCH HID 0/4] HID: selftest fixes after merge into 6.11-rc0 tree
Posted by Benjamin Tissoires 1 month, 2 weeks ago
On Tue, 23 Jul 2024 18:21:50 +0200, Benjamin Tissoires wrote:
> After HID-BPF struct_ops was merged into 6.11-rc0, there are a few
> mishaps:
> - the bpf_wq API changed and needs to be updated here
> - libbpf now auto-attach all the struct_ops it sees in the bpf object,
>   leading to attempting at attaching them multiple times
> 
> Fix the selftests but also prevent the same struct_ops to be attached
> more than once as this enters various locks, confusions, and kernel
> oopses.
> 
> [...]

Applied to hid/hid.git (for-6.11/upstream-fixes), thanks!

[1/4] selftests/hid: fix bpf_wq new API
      https://git.kernel.org/hid/hid/c/ff9fbcafbaf1
[2/4] selftests/hid: disable struct_ops auto-attach
      https://git.kernel.org/hid/hid/c/f64c1a459339
[3/4] HID: bpf: prevent the same struct_ops to be attached more than once
      https://git.kernel.org/hid/hid/c/acd34cfc48b3
[4/4] selftests/hid: add test for attaching multiple time the same struct_ops
      https://git.kernel.org/hid/hid/c/facdbdfe0e62

Cheers,
-- 
Benjamin Tissoires <bentiss@kernel.org>