]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
leds: do not overflow sysfs buffer in led_trigger_show
authorNathan Sullivan <nathan.sullivan@ni.com>
Mon, 15 Aug 2016 22:20:14 +0000 (17:20 -0500)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 11 Mar 2018 15:19:45 +0000 (16:19 +0100)
commitdff485e36287be123a844dc9164ba0417cd34552
treef35b08b4a1561505e9a035aa15cc50011c6556f7
parent6bde094049bf3648882ff8fdfabd7871f40d3935
leds: do not overflow sysfs buffer in led_trigger_show

commit 3b9b95363c45365d606ad4bbba16acca75fdf6d3 upstream.

Per the documentation, use scnprintf instead of sprintf to ensure there
is never more than PAGE_SIZE bytes of trigger names put into the
buffer.

Signed-off-by: Nathan Sullivan <nathan.sullivan@ni.com>
Signed-off-by: Zach Brown <zach.brown@ni.com>
Signed-off-by: Jacek Anaszewski <j.anaszewski@samsung.com>
Cc: Willy Tarreau <w@1wt.eu>
Cc: Vlastimil Babka <vbabka@suse.cz>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/leds/led-triggers.c