android_kernel_samsung_msm8976/drivers/remoteproc
Arnd Bergmann 2ed0426bd1 remoteproc: avoid stack overflow in debugfs file
commit 92792e48e2ae6051af30468a87994b5432da2f06 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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2016-02-19 14:22:37 -08:00
..
Kconfig This pull request contains: 2013-05-07 14:04:56 -07:00
Makefile
da8xx_remoteproc.c
omap_remoteproc.c
omap_remoteproc.h
remoteproc_core.c This pull request contains: 2013-05-07 14:04:56 -07:00
remoteproc_debugfs.c remoteproc: avoid stack overflow in debugfs file 2016-02-19 14:22:37 -08:00
remoteproc_elf_loader.c
remoteproc_internal.h
remoteproc_virtio.c
ste_modem_rproc.c This pull request contains: 2013-05-07 14:04:56 -07:00