]> git.karo-electronics.de Git - karo-tx-linux.git/commit
greybus: operation: fix incoming request payload size
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 27 Mar 2015 11:41:18 +0000 (12:41 +0100)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 30 Mar 2015 13:13:01 +0000 (15:13 +0200)
commitcfa79699cdef2e006f8414587c0e4d62209e4897
tree4950796bb4faafeb852b15f913abb4a53d63b383
parent9489667684fbed2114dcdd10cdee2e4d20d9f308
greybus: operation: fix incoming request payload size

Fix the payload size of incoming requests, which should not include the
operation message-header size.

When creating requests we pass the sizes of request and response
payloads and greybus core allocates buffers and adds the required
headers. Specifically, the payload sizes do not include the
message-header size.

This is currently not the case for incoming requests however, something
which prevents protocol drivers from implementing appropriate input
verification and could lead to random data being treated as a valid
message in case of a short request.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Reviewed-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c