On Wed, Nov 25, 2026 at 09:58:05PM +0530, Sahanur Molla wrote:
Hi,
While reading drivers/staging/greybus/loopback.c in current mainline (4dce97c), I found what looks like an out-of-bounds read.
In gb_loopback_request_handler(), case GB_LOOPBACK_TYPE_TRANSFER:
len = le32_to_cpu(request->len); if (len > gb_dev.size_max) { ... return -EINVAL; } ... memcpy(response->data, request->data, len);
'len' comes from the remote device and is only checked against gb_dev.size_max (the maximum payload size of the connection). It is never checked against the size of the payload that was actually received. A device can send a small request with a large 'len', and the kernel will copy bytes from beyond the end of the request buffer into the response, which is then sent back to the device. This is a heap over-read and a possible information leak.
raw.c in the same driver already validates len against payload_size in the equivalent place.
Untested suggested fix (not compiled or run on hardware):
This looks valid. Please send a proper compile-tested patch.
Note that your mailer corrupted the diff you included. Try using git-send-email when sending the fix.
Johan