linux/drivers/remoteproc
Arnd Bergmann 552449302b remoteproc: avoid stack overflow in debugfs file
commit 92792e48e2 upstream.

Recent gcc versions warn about reading from a negative offset of
an on-stack array:

drivers/remoteproc/remoteproc_debugfs.c: In function 'rproc_recovery_write':
drivers/remoteproc/remoteproc_debugfs.c:167:9: warning: 'buf[4294967295u]' may be used uninitialized in this function [-Wmaybe-uninitialized]

I don't see anything in sys_write() that prevents us from
being called with a zero 'count' argument, so we should
add an extra check in rproc_recovery_write() to prevent the
access and avoid the warning.

Signed-off-by: Arnd Bergmann <arnd@arndb.de>
Fixes: 2e37abb89a ("remoteproc: create a 'recovery' debugfs entry")
Signed-off-by: Ohad Ben-Cohen <ohad@wizery.com>
Signed-off-by: Luis Henriques <luis.henriques@canonical.com>
History 2016-01-05 12:08:23 +00:00
..
da8xx_remoteproc.c remoteproc/davinci: simplify use of devm_ioremap_resource 2014-02-24 11:10:24 +02:00
Kconfig remoteproc: da8xx: don't select CMA on no-MMU 2014-06-17 17:09:36 +02:00
Makefile remoteproc/davinci: add a remoteproc driver for OMAP-L13x DSP 2013-04-15 09:23:40 +03:00
omap_remoteproc.c mailbox/omap: move the OMAP mailbox framework to drivers 2013-06-11 11:41:51 -05:00
omap_remoteproc.h remoteproc/omap: add a remoteproc driver for OMAP4 2012-02-08 22:53:47 +02:00
remoteproc_core.c remoteproc: Cocci spatch "memdup.spatch" 2013-07-01 17:23:58 +03:00
remoteproc_debugfs.c remoteproc: avoid stack overflow in debugfs file 2016-01-05 12:08:23 +00:00
remoteproc_elf_loader.c remoteproc: add find_loaded_rsc_table firmware ops 2013-04-05 08:49:52 +03:00
remoteproc_internal.h remoteproc: fix checkpatch errors in remoteproc code 2013-06-30 11:33:05 +03:00
remoteproc_virtio.c virtio_ring: change host notification API 2013-10-29 11:28:11 +10:30
ste_modem_rproc.c remoteproc/ste_modem: staticize local symbols 2014-02-24 11:16:16 +02:00