media: atomisp: Fix a buffer overflow in debug code
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 20 Nov 2020 16:27:18 +0000 (17:27 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:43 +0000 (11:37 +0100)
commit28fa29bd59f2f4078c81148abe4820a0e3b71681
tree2971ac254b136e55f4c49bc2713bc02048847951
parentabfdb63b6e5f0d14159e0ed91dadc3e0e921d3f6
media: atomisp: Fix a buffer overflow in debug code

[ Upstream commit 625993166b551d633917ca35d4afb7b46d7451b4 ]

The "pad" variable is a user controlled string and we haven't properly
clamped it at this point so the debug code could print from beyond the
of the array.

Fixes: a49d25364dfb ("staging/atomisp: Add support for the Intel IPU v2")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/staging/media/atomisp/pci/atomisp_subdev.c