WSL2-Linux-Kernel/drivers/leds
Rasmus Villemoes 9093464330 leds: trigger: netdev: use memcpy in device_name_store
If userspace doesn't end the input with a newline (which can easily
happen if the write happens from a C program that does write(fd,
iface, strlen(iface))), we may end up including garbage from a
previous, longer value in the device_name. For example

# cat device_name

# printf 'eth12' > device_name
# cat device_name
eth12
# printf 'eth3' > device_name
# cat device_name
eth32

I highly doubt anybody is relying on this behaviour, so switch to
simply copying the bytes (we've already checked that size is <
IFNAMSIZ) and unconditionally zero-terminate it; of course, we also
still have to strip a trailing newline.

This is also preparation for future patches.

Fixes: 06f502f57d ("leds: trigger: Introduce a NETDEV trigger")
Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Acked-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Jacek Anaszewski <jacek.anaszewski@gmail.com>
2019-03-30 19:09:32 +01:00
..
trigger leds: trigger: netdev: use memcpy in device_name_store 2019-03-30 19:09:32 +01:00
Kconfig leds: add Panasonic AN30259A support 2018-09-10 21:31:11 +02:00
Makefile leds: add Panasonic AN30259A support 2018-09-10 21:31:11 +02:00
led-class-flash.c
led-class.c leds: class: ensure workqueue is initialized before setting brightness 2018-05-24 22:08:26 +02:00
led-core.c leds: Add helper for getting default pattern from Device Tree 2019-01-16 22:08:07 +01:00
led-triggers.c led: triggers: Initialize LED_INIT_DEFAULT_TRIGGER if trigger is brought after class 2018-12-10 21:31:55 +01:00
leds-88pm860x.c leds: 88pm860x: Use of_node_name_eq for node name comparisons 2018-12-06 21:30:08 +01:00
leds-aat1290.c LED updates for 4.14 2017-09-07 14:33:13 -07:00
leds-adp5520.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-an30259a.c leds: add Panasonic AN30259A support 2018-09-10 21:31:11 +02:00
leds-apu.c leds: Modify PC Engines apu/apu2 driver to support apu3 2018-06-28 21:34:43 +02:00
leds-as3645a.c leds: Convert to using %pOFn instead of device_node.name 2018-08-28 22:31:10 +02:00
leds-asic3.c
leds-bcm6328.c
leds-bcm6358.c
leds-bd2802.c
leds-blinkm.c leds: blinkm: avoid uninitialized data use 2018-01-08 21:28:10 +01:00
leds-clevo-mail.c dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
leds-cobalt-qube.c
leds-cobalt-raq.c
leds-cpcap.c
leds-cr0014114.c leds: Use struct_size() in allocation 2018-06-12 16:19:22 -07:00
leds-da903x.c
leds-da9052.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-dac124s085.c
leds-fsg.c
leds-gpio-register.c
leds-gpio.c leds: gpio: Drop unneeded manual of_node assignment 2018-12-08 18:17:14 +01:00
leds-hp6xx.c
leds-ipaq-micro.c
leds-is31fl32xx.c
leds-is31fl319x.c
leds-ktd2692.c
leds-lm355x.c
leds-lm3530.c
leds-lm3533.c leds: lm3533: constify attribute_group structure 2017-08-29 21:10:37 +02:00
leds-lm3601x.c leds: lm3601x: Introduce the lm3601x LED driver 2018-05-23 21:44:47 +02:00
leds-lm3642.c
leds-lm3692x.c leds: lm3692x: Support LED sync configuration 2018-07-03 22:27:12 +02:00
leds-locomo.c
leds-lp55xx-common.c leds: lp55xx: fix null deref on firmware load failure 2019-02-14 22:03:44 +01:00
leds-lp55xx-common.h
leds-lp3944.c
leds-lp3952.c
leds-lp5521.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-lp5523.c leds: lp5523: fix a missing check of return value of lp55xx_read 2019-01-17 22:27:39 +01:00
leds-lp5562.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-lp8501.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-lp8788.c
leds-lp8860.c leds: lp8860: Various fixes to align with LED framework 2018-01-08 21:28:12 +01:00
leds-lt3593.c leds: lt3593: update email address and switch to SPDX license header 2018-07-03 22:12:41 +02:00
leds-max8997.c leds: max8997: use mode when calling max8997_led_set_mode 2018-07-03 22:12:41 +02:00
leds-max77693.c
leds-mc13783.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-menf21bmc.c
leds-mlxcpld.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-mlxreg.c leds: mlxreg: Add support for capability register 2019-02-23 09:20:46 -08:00
leds-mt6323.c
leds-net48xx.c
leds-netxbig.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-nic78bx.c
leds-ns2.c leds: ns2: Change unsigned to unsigned int 2018-08-06 23:03:12 +02:00
leds-ot200.c
leds-pca955x.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-pca963x.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-pca9532.c leds: pca9532: fix a potential NULL pointer dereference 2019-03-30 18:50:00 +01:00
leds-pm8058.c leds: pm8058: Silence pointer to integer size warning 2017-12-01 08:57:42 +00:00
leds-powernv.c leds: powernv: add of_node_put() 2018-11-21 20:23:14 +01:00
leds-pwm.c leds: pwm: Use OF variant of LED registering function 2018-12-08 18:59:47 +01:00
leds-rb532.c
leds-regulator.c
leds-s3c24xx.c
leds-sc27xx-bltc.c leds: sc27xx: Add pattern_set/clear interfaces for LED controller 2018-10-11 21:59:11 +02:00
leds-ss4200.c dmi: Mark all struct dmi_system_id instances const 2017-09-14 11:59:30 +02:00
leds-sunfire.c
leds-syscon.c
leds-tca6507.c treewide: devm_kzalloc() -> devm_kcalloc() 2018-06-12 16:19:22 -07:00
leds-tlc591xx.c
leds-wm831x-status.c leds: wm831x-status: Use sysfs_match_string() helper 2018-05-03 21:50:13 +02:00
leds-wm8350.c
leds-wrap.c
leds.h
uleds.c vfs: do bulk POLL* -> EPOLL* replacement 2018-02-11 14:34:03 -08:00