summaryrefslogtreecommitdiff
path: root/drivers
diff options
context:
space:
mode:
authorHans Verkuil <hverkuil+cisco@kernel.org>2026-06-18 13:03:19 +0200
committerHans Verkuil <hverkuil+cisco@kernel.org>2026-06-29 16:10:36 +0200
commitabac9820b26b5cfcb01eb79efe2abdd0ac7e07c3 (patch)
treef9822d5c7230051c80c19dc004a03993ebb53125 /drivers
parentfb9dda38d4b9e90db07ed9a0ee2d35bf85494035 (diff)
downloadlinux-next-abac9820b26b5cfcb01eb79efe2abdd0ac7e07c3.tar.gz
linux-next-abac9820b26b5cfcb01eb79efe2abdd0ac7e07c3.zip
media: cec: extron-da-hd-4k-plus: add sanity check
Add check to prevent overflowing msg.msg[] in case the incoming data is malformed. Signed-off-by: Hans Verkuil <hverkuil+cisco@kernel.org> Reviewed-by: Sean Young <sean@mess.org> Fixes: 056f2821b631 ("media: cec: extron-da-hd-4k-plus: add the Extron DA HD 4K Plus CEC driver") Cc: stable@vger.kernel.org
Diffstat (limited to 'drivers')
-rw-r--r--drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
index 3381d86096a1..3c6ce6f3d93e 100644
--- a/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
+++ b/drivers/media/cec/usb/extron-da-hd-4k-plus/extron-da-hd-4k-plus.c
@@ -657,7 +657,8 @@ static void extron_process_received(struct extron_port *port, const char *data)
if (!port || port->disconnected)
return;
- if (len < 5 || (len - 2) % 3 || data[len - 2] != '*')
+ if (len < 5 || ((len - 2) / 3 > sizeof(msg.msg)) ||
+ (len - 2) % 3 || data[len - 2] != '*')
goto malformed;
while (*data != '*') {