Skip to content

leds: fix attribute-creation races

Johan Hovold linux-input linux-leds lkml 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest13 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/13leds: add led-class attribute-group supportdrivers/leds/led-class.c include/linux/leds.h+5 -20 replies
2/13leds: lm3550: fix attribute-creation racedrivers/leds/leds-lm3530.c+7 -130 replies
3/13leds: lm3533: fix attribute-creation racedrivers/leds/leds-lm3533.c+8 -120 replies
4/13leds: lm355x: fix attribute-creation racedrivers/leds/leds-lm355x.c+9 -120 replies
5/13leds: lm3642: fix attribute-creation racedrivers/leds/leds-lm3642.c+14 -160 replies
6/13leds: max8997: fix attribute-creation racedrivers/leds/leds-max8997.c+7 -90 replies
7/13leds: netxbig: fix attribute-creation racedrivers/leds/leds-netxbig.c+12 -141 reply
8/13leds: ns2: fix attribute-creation racedrivers/leds/leds-ns2.c+7 -90 replies
9/13leds: ss4200: fix attribute-creation racedrivers/leds/leds-ss4200.c+9 -50 replies
10/13leds: wm831x-status: fix attribute-creation racedrivers/leds/leds-wm831x-status.c+9 -140 replies
11/13input: lm8323: fix attribute-creation racedrivers/input/keyboard/lm8323.c+9 -133 replies
12/13leds: lp55xx-common: fix sysfs entry leakdrivers/leds/leds-lp55xx-common.c+2 -00 replies
13/13leds: lp55xx-common: fix attribute-creation racedrivers/leds/leds-lp55xx-common.c+3 -190 replies

Reviews trailers per patch

1 of 13 patches has a Reviewed-by or Acked-by.

PatchDmitry Torokhov
1/13
2/13
3/13
4/13
5/13
6/13
7/13
8/13
9/13
10/13
11/13A-b
12/13
13/13

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v1 thread

Cover letter [PATCH 00/13] leds: fix attribute-creation races

LED-class device attributes should be created using the attribute groups of struct device, rather than be added manually after the device has been registered in order to avoid racing with userspace.

The first patch adds an attribute groups field to struct led_classdev, which is used during registration to add device attributes in a race-free manner.

The remaining patches convert the current racy LED-device attribute creations to use the new facility. Hopefully my grep-patterns have caught most instances. Note that this also tends to simplify probe error paths.

The lp55xx-common failed to remove the attribute group it is currently creating, something which is fixed separately.

Note that this series include one driver from drivers/input/keyboard.

The individual led-driver patches have been compile tested only.

Johan

Johan Hovold (13):
leds: add led-class attribute-group support
leds: lm3550: fix attribute-creation race
leds: lm3533: fix attribute-creation race
leds: lm355x: fix attribute-creation race
leds: lm3642: fix attribute-creation race
leds: max8997: fix attribute-creation race
leds: netxbig: fix attribute-creation race
leds: ns2: fix attribute-creation race
leds: ss4200: fix attribute-creation race
leds: wm831x-status: fix attribute-creation race
input: lm8323: fix attribute-creation race
leds: lp55xx-common: fix sysfs entry leak
leds: lp55xx-common: fix attribute-creation race

 drivers/input/keyboard/lm8323.c   | 22 +++++++++-------------
 drivers/leds/led-class.c          |  5 +++--
 drivers/leds/leds-lm3530.c        | 20 +++++++-------------
 drivers/leds/leds-lm3533.c        | 20 ++++++++------------
 drivers/leds/leds-lm355x.c        | 21 +++++++++------------
 drivers/leds/leds-lm3642.c        | 30 ++++++++++++++----------------
 drivers/leds/leds-lp55xx-common.c | 20 +++-----------------
 drivers/leds/leds-max8997.c       | 16 +++++++---------
 drivers/leds/leds-netxbig.c       | 26 ++++++++++++--------------
 drivers/leds/leds-ns2.c           | 16 +++++++---------
 drivers/leds/leds-ss4200.c        | 14 +++++++++-----
 drivers/leds/leds-wm831x-status.c | 23 +++++++++--------------
 include/linux/leds.h              |  2 ++
 13 files changed, 99 insertions(+), 136 deletions(-)
Signature · 1 line
1.8.5.5