Commit 85b1ac73 authored by Michael Zoran's avatar Michael Zoran Committed by Greg Kroah-Hartman

staging: bcm2835-camera: Fix buffer overflow calculation on query of camera properties

The code that queries properties on the camera has a check
for buffer overruns if the firmware sends too much data.  This
check is incorrect, and during testing I was seeing stack corruption.

I believe this error can actually happen in normal use, just for
some reason it doesn't appear on 32 bit as often.  So perhaps
it's best for the check to be fixed.
Signed-off-by: default avatarMichael Zoran <mzoran@crowfest.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 74369b5f
...@@ -1442,7 +1442,7 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance, ...@@ -1442,7 +1442,7 @@ static int port_parameter_get(struct vchiq_mmal_instance *instance,
} }
ret = -rmsg->u.port_parameter_get_reply.status; ret = -rmsg->u.port_parameter_get_reply.status;
if (ret) { if (ret || (rmsg->u.port_parameter_get_reply.size > *value_size)) {
/* Copy only as much as we have space for /* Copy only as much as we have space for
* but report true size of parameter * but report true size of parameter
*/ */
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment