]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer
authorDouglas Anderson <dianders@chromium.org>
Thu, 14 Dec 2023 20:37:52 +0000 (12:37 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Jan 2024 17:51:08 +0000 (18:51 +0100)
commit5d3e98ef12f654ce58a83ca64e8178cfb5e0a935
tree7130a05e76c55d4b810c68f41edb6a1e28a49dc9
parent2f8cefc8b6388ed0cb0e9fe38e424cd62b92f1a2
drm/bridge: ti-sn65dsi86: Never store more than msg->size bytes in AUX xfer

[ Upstream commit aca58eac52b88138ab98c814afb389a381725cd7 ]

For aux reads, the value `msg->size` indicates the size of the buffer
provided by `msg->buffer`. We should never in any circumstances write
more bytes to the buffer since it may overflow the buffer.

In the ti-sn65dsi86 driver there is one code path that reads the
transfer length from hardware. Even though it's never been seen to be
a problem, we should make extra sure that the hardware isn't
increasing the length since doing so would cause us to overrun the
buffer.

Fixes: 982f589bde7a ("drm/bridge: ti-sn65dsi86: Update reply on aux failures")
Reviewed-by: Stephen Boyd <swboyd@chromium.org>
Reviewed-by: Guenter Roeck <groeck@chromium.org>
Signed-off-by: Douglas Anderson <dianders@chromium.org>
Link: https://patchwork.freedesktop.org/patch/msgid/20231214123752.v3.2.I7b83c0f31aeedc6b1dc98c7c741d3e1f94f040f8@changeid
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/bridge/ti-sn65dsi86.c