mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
* [PATCH v2 0/2] HID: bpf: fix device destruction races
@ 2026-11-03  2:45 Yifan Zhang
  2026-11-03  2:45 ` [PATCH v2 1/2] HID: bpf: synchronize hardware operations with device destruction Yifan Zhang
  2026-11-03  2:45 ` [PATCH v2 2/2] HID: bpf: reject struct_ops registration during " Yifan Zhang
  0 siblings, 2 replies; 4+ messages in thread
From: Yifan Zhang @ 2026-11-03  2:45 UTC (permalink / raw)
  To: Jiri Kosina, Benjamin Tissoires, linux-input
  Cc: Greg Kroah-Hartman, Alexei Starovoitov, bpf, linux-kernel

These patches fix two HID-BPF races with device destruction.  The first
keeps report metadata and transport-private state alive across hardware
operations.  The second prevents struct_ops registration from publishing
an entry after destruction has started.

Changes in v2:
- use a short lifetime admission lock and SRCU instead of holding
  prog_list_lock across low-level driver calls
- acquire lifetime protection before looking up the HID report
- clear ops->hdev on registration errors before dropping the device ref

Yifan Zhang (2):
  HID: bpf: synchronize hardware operations with device destruction
  HID: bpf: reject struct_ops registration during device destruction

 drivers/hid/bpf/hid_bpf_dispatch.c   | 73 ++++++++++++++++++++--------
 drivers/hid/bpf/hid_bpf_struct_ops.c | 12 ++++-
 include/linux/hid_bpf.h              |  1 +
 3 files changed, 65 insertions(+), 21 deletions(-)

-- 
2.39.5 (Apple Git-154)

^ permalink raw reply	[flat|nested] 4+ messages in thread

end of thread, other threads:[~2026-11-03  3:00 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2026-11-03  2:45 [PATCH v2 0/2] HID: bpf: fix device destruction races Yifan Zhang
2026-11-03  2:45 ` [PATCH v2 1/2] HID: bpf: synchronize hardware operations with device destruction Yifan Zhang
2026-11-03  3:00   ` Alexei Starovoitov
2026-11-03  2:45 ` [PATCH v2 2/2] HID: bpf: reject struct_ops registration during " Yifan Zhang

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®