bcm2835-v4l2: Fix buffer overflow problem
authorDave Stevenson <dave.stevenson@raspberrypi.org>
Fri, 10 Mar 2017 14:43:15 +0000 (14:43 +0000)
committerRaspbian kernel package updater <root@raspbian.org>
Sun, 8 Oct 2017 01:00:27 +0000 (01:00 +0000)
commit8d2ad4f0d4a6f53f21ce8f35391f9d7504661b39
treeaad3020cfb0a04cf50c99c746d1d141e1a7fc3bb
parentdaacd28e3669c74fa16d01135634b601f16a67fd
bcm2835-v4l2: Fix buffer overflow problem

https://github.com/raspberrypi/linux/issues/1447
port_parameter_get() failed to account for the header
(u32 id and u32 size) in the size before memcpying
the response into the response buffer, so overrunning
the provided buffer by 8 bytes.

Account for those bytes, and also a belt-and-braces
check to ensure we never copy more than *value_size
bytes into value.

Signed-off-by: Dave Stevenson <dave.stevenson@raspberrypi.org>
drivers/media/platform/bcm2835/mmal-vchiq.c