Skip to content

HID: sensor: custom: use-after-free after remove

Srinivas Pandruvada linux-iio linux-input lkml 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v3 Latest7 patches 3 repliesIn review
  2. v27 patches 11 repliesSuperseded

Changes in v3 from the cover letter

- Address comment on patch 6/7 by Shashiko on useless goto and suggestion to remove sensor_hub_remove_callback() for err_remove_dev_if.
- On patch 4/7 : HID: sensor: custom: Fix state lifetime during removal Rename goto as suggested by Jonathan

Patches in v3 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/7HID: sensor-hub: Synchronize callback removal with raw eventsdrivers/hid/hid-sensor-hub.c+5 -20 replies
2/7HID: sensor: custom: Set owner for misc devicedrivers/hid/hid-sensor-custom.c+1 -00 replies
3/7HID: sensor: custom: Disable sensor before hub close on removaldrivers/hid/hid-sensor-custom.c+7 -00 replies
4/7HID: sensor: custom: Fix state lifetime during removaldrivers/hid/hid-sensor-custom.c+56 -250 replies
5/7HID: sensor: custom: Serialize misc device readsdrivers/hid/hid-sensor-custom.c+21 -50 replies
6/7HID: sensor: custom: Register enable attribute after misc devicedrivers/hid/hid-sensor-custom.c+6 -70 replies
7/7HID: sensor-hub: Remove clients before stopping hardwaredrivers/hid/hid-sensor-hub.c+17 -30 replies

Reviews trailers per patch

3 of 7 patches have a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchJoshua CroftsSemyon MaryasinZhang LixuJonathan Cameron
SeriesT-b R-b
1/7R-b T-b T-b
2/7R-b T-b T-b
3/7R-b T-b T-b
4/7T-b T-b
5/7T-b T-b
6/7T-b T-b
7/7T-b T-b

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes. Scroll the table sideways for all 4 reviewers.

Read the v3 thread

Cover letter [PATCH v3 0/7] HID: sensor: custom: use-after-free after remove

This is v3 version with changes suggested by shashiko-bot and Jonathan. Also rebased on top of 7.4-rc2 kernel release.

This patch series is essentially the same version that was sent to Semyon for testing.

Following a feedback review conducted with various AI models, it was suggested to break each change into individual, separate patches. This makes perfect sense, which is why this series now contains more patches.

Additionally, these reviews identified issues in the adjacent probe and removal code when active sensor instances are present. I have addressed those issues in this version as well.

v3:
- Address comment on patch 6/7 by Shashiko on useless goto and suggestion to remove sensor_hub_remove_callback() for err_remove_dev_if.
- On patch 4/7 : HID: sensor: custom: Fix state lifetime during removal Rename goto as suggested by Jonathan

For using guard(), need a follow up patch as that will be a cleanup.

Srinivas Pandruvada (7):
HID: sensor-hub: Synchronize callback removal with raw events
HID: sensor: custom: Set owner for misc device
HID: sensor: custom: Disable sensor before hub close on removal
HID: sensor: custom: Fix state lifetime during removal
HID: sensor: custom: Serialize misc device reads
HID: sensor: custom: Register enable attribute after misc device
HID: sensor-hub: Remove clients before stopping hardware

 drivers/hid/hid-sensor-custom.c | 118 +++++++++++++++++++++++---------
 drivers/hid/hid-sensor-hub.c    |  27 ++++++--
 2 files changed, 108 insertions(+), 37 deletions(-)
Signature · 1 line
2.56.0