linux-stable/drivers/leds
Christian Marangi 10f2af1af8 leds: trigger: netdev: Fix kernel panic on interface rename trig notify
[ Upstream commit 415798bc07 ]

Commit d5e01266e7 ("leds: trigger: netdev: add additional specific link
speed mode") in the various changes, reworked the way to set the LINKUP
mode in commit cee4bd16c3 ("leds: trigger: netdev: Recheck
NETDEV_LED_MODE_LINKUP on dev rename") and moved it to a generic function.

This changed the logic where, in the previous implementation the dev
from the trigger event was used to check if the carrier was ok, but in
the new implementation with the generic function, the dev in
trigger_data is used instead.

This is problematic and cause a possible kernel panic due to the fact
that the dev in the trigger_data still reference the old one as the
new one (passed from the trigger event) still has to be hold and saved
in the trigger_data struct (done in the NETDEV_REGISTER case).

On calling of get_device_state(), an invalid net_dev is used and this
cause a kernel panic.

To handle this correctly, move the call to get_device_state() after the
new net_dev is correctly set in trigger_data (in the NETDEV_REGISTER
case) and correctly parse the new dev.

Fixes: d5e01266e7 ("leds: trigger: netdev: add additional specific link speed mode")
Cc: stable@vger.kernel.org
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Reviewed-by: Andrew Lunn <andrew@lunn.ch>
Link: https://lore.kernel.org/r/20240203235413.1146-1-ansuelsmth@gmail.com
Signed-off-by: Lee Jones <lee@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2024-04-03 15:28:27 +02:00
..
blink leds: bcm63138: Rename dependency symbol ARCH_BCM4908 to ARCH_BCMBCA 2023-07-28 09:59:58 +01:00
flash leds: sgm3140: Add missing timer cleanup and flash gpio control 2024-03-26 18:19:55 -04:00
rgb leds: rgb: Add a multicolor LED driver to group monochromatic LEDs 2023-08-17 09:01:00 +01:00
simple - Core Frameworks 2023-09-04 13:52:58 -07:00
trigger leds: trigger: netdev: Fix kernel panic on interface rename trig notify 2024-04-03 15:28:27 +02:00
Kconfig leds: aw2013: Select missing dependency REGMAP_I2C 2024-01-25 15:35:49 -08:00
Makefile leds: pca995x: Add support for PCA995X chips 2023-07-28 09:26:28 +01:00
TODO
led-class-flash.c
led-class-multicolor.c leds: multicolor: Use rounded division when calculating color components 2023-08-17 11:25:03 +01:00
led-class.c leds: class: Don't expose color sysfs entry 2023-12-08 08:52:15 +01:00
led-core.c leds: Drop BUG_ON check for LED_COLOR_ID_MULTI 2023-09-19 15:16:23 +01:00
led-triggers.c
leds-88pm860x.c
leds-acer-a500.c
leds-adp5520.c
leds-an30259a.c leds: Remove redundant of_match_ptr() 2023-08-17 13:28:25 +01:00
leds-apu.c
leds-ariel.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-aw200xx.c leds: aw200xx: Fix write to DIM parameter 2024-01-25 15:35:49 -08:00
leds-aw2013.c leds: aw2013: Unlock mutex before destroying it 2024-03-26 18:19:55 -04:00
leds-bcm6328.c
leds-bcm6358.c
leds-bd2606mvv.c
leds-bd2802.c
leds-blinkm.c
leds-cht-wcove.c
leds-clevo-mail.c
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-cr0014114.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-da903x.c
leds-da9052.c
leds-dac124s085.c
leds-el15203000.c
leds-gpio-register.c
leds-gpio.c
leds-hp6xx.c
leds-ip30.c leds: ip30: Convert to devm_platform_ioremap_resource() 2023-07-28 09:26:21 +01:00
leds-ipaq-micro.c
leds-is31fl32xx.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-is31fl319x.c
leds-lm355x.c
leds-lm3530.c
leds-lm3532.c
leds-lm3533.c
leds-lm3642.c
leds-lm3692x.c
leds-lm3697.c
leds-lm36274.c
leds-locomo.c
leds-lp50xx.c
leds-lp55xx-common.c
leds-lp55xx-common.h
leds-lp3944.c
leds-lp3952.c
leds-lp5521.c leds: Remove redundant of_match_ptr() 2023-08-17 13:28:25 +01:00
leds-lp5523.c leds: Remove redundant of_match_ptr() 2023-08-17 13:28:25 +01:00
leds-lp5562.c leds: Remove redundant of_match_ptr() 2023-08-17 13:28:25 +01:00
leds-lp8501.c leds: Remove redundant of_match_ptr() 2023-08-17 13:28:25 +01:00
leds-lp8788.c
leds-lp8860.c
leds-lt3593.c
leds-max8997.c
leds-max77650.c
leds-mc13783.c
leds-menf21bmc.c
leds-mlxcpld.c
leds-mlxreg.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-mt6323.c
leds-net48xx.c
leds-netxbig.c
leds-nic78bx.c
leds-ns2.c leds: ns2: Slightly simplify a memory allocation 2023-07-28 11:58:04 +01:00
leds-ot200.c
leds-pca955x.c
leds-pca963x.c
leds-pca995x.c leds: pca995x: Fix MODULE_DEVICE_TABLE for OF 2023-08-15 18:30:07 +01:00
leds-pca9532.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-pm8058.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-powernv.c
leds-pwm.c leds: pwm: Don't disable the PWM when the LED should be off 2023-11-20 11:59:24 +01:00
leds-rb532.c
leds-regulator.c
leds-sc27xx-bltc.c
leds-spi-byte.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-ss4200.c
leds-sunfire.c
leds-syscon.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-tca6507.c
leds-ti-lmu-common.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-tlc591xx.c leds: Explicitly include correct DT includes 2023-07-28 10:02:32 +01:00
leds-tps6105x.c
leds-turris-omnia.c leds: turris-omnia: Do not use SMBUS calls 2023-11-20 11:59:24 +01:00
leds-wm831x-status.c
leds-wm8350.c
leds-wrap.c
leds.h
uleds.c leds: uleds: Use module_misc_device macro to simplify the code 2023-08-18 11:42:54 +01:00