[PATCH 0/2] HID: bpf: close device teardown races

From: Yifan Zhang

Date: Mon Nov 02 2026 - 07:04:38 EST


HID-BPF can race device destruction in two paths. A hardware request can
outlive transport-private state, and a struct_ops registration can resume
after destruction has cleaned the device's SRCU state.

Serialize HID-BPF hardware operations with the destruction transition, then
reject registrations that acquire prog_list_lock after that transition.

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

drivers/hid/bpf/hid_bpf_dispatch.c | 36 +++++++++++++++++++---------
drivers/hid/bpf/hid_bpf_struct_ops.c | 5 ++++
2 files changed, 30 insertions(+), 11 deletions(-)

--
2.39.5 (Apple Git-154)