Skip to content

leds: fix broken devres usage

Johan Hovold linux-leds lkml stable 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 8 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6leds: 88pm860x: fix use-after-free on unbinddrivers/leds/leds-88pm860x.c+13 -10 replies
2/6leds: da903x: fix use-after-free on unbinddrivers/leds/leds-da903x.c+13 -10 replies
3/6leds: lm3533: fix use-after-free on unbinddrivers/leds/leds-lm3533.c+9 -30 replies
4/6leds: lm36274: fix use-after-free on unbinddrivers/leds/leds-lm36274.c+12 -30 replies
5/6leds: wm831x-status: fix use-after-free on unbinddrivers/leds/leds-wm831x-status.c+13 -10 replies
6/6leds: drop redundant struct-device pointer castsdrivers/leds/leds-lm355x.c drivers/leds/leds-lm3642.c+6 -120 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/6] leds: fix broken devres usage

Several MFD child drivers register their class devices directly under the parent device (about half of the MFD LED drivers do so).

This means you cannot blindly do devres conversions so that deregistration ends up being tied to the parent device, something which leads to use-after-free on driver unbind when the class device is released while still being registered (and, for example, oopses on later parent MFD driver unbind or LED class callbacks, or resource leaks and name clashes on child driver reload).

Included is also a clean up removing some pointless casts when registering class devices.

All but the lm3533 one have only been compile tested.

Johan

Johan Hovold (6):
leds: 88pm860x: fix use-after-free on unbind
leds: da903x: fix use-after-free on unbind
leds: lm3533: fix use-after-free on unbind
leds: lm36274: fix use-after-free on unbind
leds: wm831x-status: fix use-after-free on unbind
leds: drop redundant struct-device pointer casts

 drivers/leds/leds-88pm860x.c      | 14 +++++++++++++-
 drivers/leds/leds-da903x.c        | 14 +++++++++++++-
 drivers/leds/leds-lm3533.c        | 12 +++++++++---
 drivers/leds/leds-lm355x.c        |  9 +++------
 drivers/leds/leds-lm36274.c       | 15 ++++++++++++---
 drivers/leds/leds-lm3642.c        |  9 +++------
 drivers/leds/leds-wm831x-status.c | 14 +++++++++++++-
 7 files changed, 66 insertions(+), 21 deletions(-)
Signature · 1 line
2.26.2