linux-stable/include
Benjamin Tissoires 4b9a3f49f0 HID: bpf: rework how programs are attached and stored in the kernel
Previously, HID-BPF was relying on a bpf tracing program to be notified
when a program was released from userspace. This is error prone, as
LLVM sometimes inline the function and sometimes not.

So instead of messing up with the bpf prog ref count, we can use the
bpf_link concept which actually matches exactly what we want:
- a bpf_link represents the fact that a given program is attached to a
  given HID device
- as long as the bpf_link has fd opened (either by the userspace program
  still being around or by pinning the bpf object in the bpffs), the
  program stays attached to the HID device
- once every user has closed the fd, we get called by
  hid_bpf_link_release() that we no longer have any users, and we can
  disconnect the program to the device in 2 passes: first atomically clear
  the bit saying that the link is active, and then calling release_work in
  a scheduled work item.

This solves entirely the problems of BPF tracing not showing up and is
definitely cleaner.

Signed-off-by: Benjamin Tissoires <benjamin.tissoires@redhat.com>
Acked-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Jiri Kosina <jkosina@suse.cz>
2023-01-18 22:08:38 +01:00
..
acpi ACPI: APEI: Fix integer overflow in ghes_estatus_pool_init() 2022-10-13 20:40:09 +02:00
asm-generic asm-generic: compat: fix compat_arg_u64() and compat_arg_u64_dual() 2022-11-01 10:20:11 +11:00
clocksource
crypto
drm Merge drm/drm-fixes into drm-misc-fixes 2022-10-20 09:09:00 +02:00
dt-bindings These are the pin control changes for the v6.1 kernel cycle: 2022-10-11 10:59:59 -07:00
keys
kunit kunit: declare kunit_assert structs as const 2022-10-07 10:19:18 -06:00
kvm
linux HID: bpf: rework how programs are attached and stored in the kernel 2023-01-18 22:08:38 +01:00
math-emu
media media fixes for v6.1-rc2 2022-10-22 15:30:15 -07:00
memory
misc
net netlink: introduce bigendian integer types 2022-11-01 21:29:06 -07:00
pcmcia
ras
rdma
rv
scsi SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
soc RISC-V Patches for the 6.1 Merge Window, Part 2 2022-10-14 11:21:11 -07:00
sound ASoC: Fixes for v6.1 2022-10-27 08:26:32 +02:00
target
trace linux-watchdog 6.1-rc2 tag 2022-10-21 12:25:39 -07:00
uapi drm fixes for 6.1-rc5 2022-11-11 08:50:36 -08:00
ufs SCSI misc on 20221007 2022-10-07 12:33:18 -07:00
vdso
video
xen xen/virtio: enable grant based virtio on x86 2022-10-10 14:31:26 +02:00