]> 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:12:18 +0000 (16:12 +0100)
commitee23d044822561ff53aa993b8be4e0e699d8f672
tree7598f4540aef621e63cc5f75f96ec87902101bdd
parent9561b28349a22c808c3ce25eaed4d132104bafb7
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