]> www.infradead.org Git - users/dwmw2/linux.git/commit
mmc: davinci_mmc: Prevent transmitted data size from exceeding sgm's length
authorBastien Curutchet <bastien.curutchet@bootlin.com>
Thu, 11 Jul 2024 08:18:37 +0000 (10:18 +0200)
committerUlf Hansson <ulf.hansson@linaro.org>
Thu, 11 Jul 2024 15:48:54 +0000 (17:48 +0200)
commit16198eef11c1929374381d7f6271b4bf6aa44615
tree0f631006be8d9c0107dcfcccf79d1d027102b5e3
parent63d20a94f24fc1cbaf44d0e7c0e0a8077fde0aef
mmc: davinci_mmc: Prevent transmitted data size from exceeding sgm's length

No check is done on the size of the data to be transmiited. This causes
a kernel panic when this size exceeds the sg_miter's length.

Limit the number of transmitted bytes to sgm->length.

Cc: stable@vger.kernel.org
Fixes: ed01d210fd91 ("mmc: davinci_mmc: Use sg_miter for PIO")
Signed-off-by: Bastien Curutchet <bastien.curutchet@bootlin.com>
Link: https://lore.kernel.org/r/20240711081838.47256-2-bastien.curutchet@bootlin.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
drivers/mmc/host/davinci_mmc.c