mbox series

[HID,for-next,v3,0/5] HID: bpf: remove the need for ALLOW_ERROR_INJECTION and Kconfig fixes

Message ID 20221206145936.922196-1-benjamin.tissoires@redhat.com (mailing list archive)
Headers show
Series HID: bpf: remove the need for ALLOW_ERROR_INJECTION and Kconfig fixes | expand

Message

Benjamin Tissoires Dec. 6, 2022, 2:59 p.m. UTC
Hi,

This is a new version of the ALLOW_ERROR_INJECTION hack removal.

Compared to v2, I followed the review from Alexei which cleaned up the
code a little bit.

I also got a kbuild test bot complaining[3] so add a fix for that too.

For reference, here is the previous cover letter:

So this patch series aims at solving both [0] and [1].

The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API.
It is considered as a hack to begin with, so introduce a proper kernel
API to declare when a BPF hook can have its return value changed.

The second one is related to the fact that
DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and
that means that the current HID-BPF implementation doesn't work there
for now.

The first patch actually touches the bpf core code, but it would be
easier if we could merge it through the hid tree in the for-6.2/hid-bpf
branch once we get the proper acks.

Cheers,
Benjamin

[0] https://lore.kernel.org/all/20221121104403.1545f9b5@gandalf.local.home/
[1] https://lore.kernel.org/r/CABRcYmKyRchQhabi1Vd9RcMQFCcb=EtWyEbFDFRTc-L-U8WhgA@mail.gmail.com
[3] https://lore.kernel.org/all/202212060216.a6X8Py5H-lkp@intel.com/

Benjamin Tissoires (5):
  bpf: do not rely on ALLOW_ERROR_INJECTION for fmod_ret
  HID: bpf: do not rely on ALLOW_ERROR_INJECTION
  HID: bpf: enforce HID_BPF dependencies
  selftests: hid: ensures we have the proper requirements in config
  kselftests: hid: fix missing headers_install step

 drivers/hid/bpf/Kconfig              |  3 ++-
 drivers/hid/bpf/hid_bpf_dispatch.c   | 20 +++++++++++++++++--
 drivers/hid/bpf/hid_bpf_jmp_table.c  |  1 -
 include/linux/btf.h                  |  2 ++
 kernel/bpf/btf.c                     | 30 +++++++++++++++++++++++-----
 kernel/bpf/verifier.c                | 17 ++++++++++++++--
 net/bpf/test_run.c                   | 14 ++++++++++---
 tools/testing/selftests/hid/Makefile | 26 +++++++++++-------------
 tools/testing/selftests/hid/config   |  1 +
 9 files changed, 86 insertions(+), 28 deletions(-)

Comments

patchwork-bot+netdevbpf@kernel.org Dec. 7, 2022, 10 p.m. UTC | #1
Hello:

This series was applied to bpf/bpf-next.git (master)
by Benjamin Tissoires <benjamin.tissoires@redhat.com>:

On Tue,  6 Dec 2022 15:59:31 +0100 you wrote:
> Hi,
> 
> This is a new version of the ALLOW_ERROR_INJECTION hack removal.
> 
> Compared to v2, I followed the review from Alexei which cleaned up the
> code a little bit.
> 
> [...]

Here is the summary with links:
  - [HID,for-next,v3,1/5] bpf: do not rely on ALLOW_ERROR_INJECTION for fmod_ret
    https://git.kernel.org/bpf/bpf-next/c/5b481acab4ce
  - [HID,for-next,v3,2/5] HID: bpf: do not rely on ALLOW_ERROR_INJECTION
    (no matching commit)
  - [HID,for-next,v3,3/5] HID: bpf: enforce HID_BPF dependencies
    (no matching commit)
  - [HID,for-next,v3,4/5] selftests: hid: ensures we have the proper requirements in config
    (no matching commit)
  - [HID,for-next,v3,5/5] kselftests: hid: fix missing headers_install step
    (no matching commit)

You are awesome, thank you!
Jiri Kosina Dec. 10, 2022, 9:07 a.m. UTC | #2
On Tue, 6 Dec 2022, Benjamin Tissoires wrote:

> Compared to v2, I followed the review from Alexei which cleaned up the
> code a little bit.
> 
> I also got a kbuild test bot complaining[3] so add a fix for that too.
> 
> For reference, here is the previous cover letter:
> 
> So this patch series aims at solving both [0] and [1].
> 
> The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API.
> It is considered as a hack to begin with, so introduce a proper kernel
> API to declare when a BPF hook can have its return value changed.
> 
> The second one is related to the fact that
> DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and
> that means that the current HID-BPF implementation doesn't work there
> for now.
> 
> The first patch actually touches the bpf core code, but it would be
> easier if we could merge it through the hid tree in the for-6.2/hid-bpf
> branch once we get the proper acks.

For the series:

	Reviewed-by: Jiri Kosina <jkosina@suse.cz>

Thanks,
Benjamin Tissoires Dec. 10, 2022, 9:43 a.m. UTC | #3
On Sat, Dec 10, 2022 at 10:07 AM Jiri Kosina <jikos@kernel.org> wrote:
>
> On Tue, 6 Dec 2022, Benjamin Tissoires wrote:
>
> > Compared to v2, I followed the review from Alexei which cleaned up the
> > code a little bit.
> >
> > I also got a kbuild test bot complaining[3] so add a fix for that too.
> >
> > For reference, here is the previous cover letter:
> >
> > So this patch series aims at solving both [0] and [1].
> >
> > The first one is bpf related and concerns the ALLOW_ERROR_INJECTION API.
> > It is considered as a hack to begin with, so introduce a proper kernel
> > API to declare when a BPF hook can have its return value changed.
> >
> > The second one is related to the fact that
> > DYNAMIC_FTRACE_WITH_DIRECT_CALLS is currently not enabled on arm64, and
> > that means that the current HID-BPF implementation doesn't work there
> > for now.
> >
> > The first patch actually touches the bpf core code, but it would be
> > easier if we could merge it through the hid tree in the for-6.2/hid-bpf
> > branch once we get the proper acks.
>
> For the series:
>
>         Reviewed-by: Jiri Kosina <jkosina@suse.cz>

Thanks. I have applied the rest of the series to for-6.2/hid-bpf.

Cheers,
Benjamin

>
> Thanks,
>
> --
> Jiri Kosina
> SUSE Labs
>