media: bcm2835-unicam: Fix for possible dummy buffer overrun
authorNaushir Patuck <naush@raspberrypi.com>
Fri, 2 Sep 2022 07:35:35 +0000 (08:35 +0100)
committerDom Cobley <popcornmix@gmail.com>
Mon, 19 Feb 2024 11:33:24 +0000 (11:33 +0000)
commit956816cb492cfbfa41ffa249b0d3613d3628c687
tree5f829eb85a6d54effe9958ae140decaa2b63c479
parentc132fc39fb101d9b2c3aefc9685004165ff1559b
media: bcm2835-unicam: Fix for possible dummy buffer overrun

The Unicam hardware has been observed to cause a buffer overrun when using the
dummy buffer as a circular buffer. The conditions that cause the overrun are not
fully known, but it seems to occur when the memory bus is heavily loaded.

To avoid the overrun, program the hardware with a buffer size of 0 when using
the dummy buffer. This will cause overrun into the allocated dummy buffer, but
avoid out of bounds writes.

Signed-off-by: Naushir Patuck <naush@raspberrypi.com>
drivers/media/platform/bcm2835/bcm2835-unicam.c