]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
greybus: gb-beagleplay: bound bootloader receive buffering
authorPengpeng Hou <pengpeng@iscas.ac.cn>
Thu, 2 Apr 2026 05:40:16 +0000 (13:40 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 2 Apr 2026 13:55:09 +0000 (15:55 +0200)
commit1214bf28965ceaf584fb20d357731264dd2e10e1
tree8ed11fe8510871489e72f4236239ab14ae78fb96
parent21a8995cdbc7de4a57215a57095003d0e08ca1a3
greybus: gb-beagleplay: bound bootloader receive buffering

cc1352_bootloader_rx() appends each serdev chunk into the fixed
rx_buffer before parsing bootloader packets. The helper can keep
leftover bytes between callbacks and may receive multiple packets in one
callback, so a single count value is not constrained by one packet
length.

Check that the incoming chunk fits in the remaining receive buffer space
before memcpy(). If it does not, drop the staged data and consume the
bytes instead of overflowing rx_buffer.

Fixes: 0cf7befa3ea2 ("greybus: gb-beagleplay: Add firmware upload API")
Cc: stable <stable@kernel.org>
Signed-off-by: Pengpeng Hou <pengpeng@iscas.ac.cn>
Link: https://patch.msgid.link/20260402054016.38587-1-pengpeng@iscas.ac.cn
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/greybus/gb-beagleplay.c