]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
mtk-sd: Prevent memory corruption from DMA map failure
authorMasami Hiramatsu (Google) <mhiramat@kernel.org>
Thu, 12 Jun 2025 11:26:10 +0000 (20:26 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 17 Jul 2025 16:27:49 +0000 (18:27 +0200)
commitd54771571f74a82c59830a32e76af78a8e57ac69
treec3f5f8f005200face271cf3c030e01e3a07db240
parent7f5475bc136c1648e08ccd7ccd1713a1a303319a
mtk-sd: Prevent memory corruption from DMA map failure

[ Upstream commit f5de469990f19569627ea0dd56536ff5a13beaa3 ]

If msdc_prepare_data() fails to map the DMA region, the request is
not prepared for data receiving, but msdc_start_data() proceeds
the DMA with previous setting.
Since this will lead a memory corruption, we have to stop the
request operation soon after the msdc_prepare_data() fails to
prepare it.

Signed-off-by: Masami Hiramatsu (Google) <mhiramat@kernel.org>
Fixes: 208489032bdd ("mmc: mediatek: Add Mediatek MMC driver")
Cc: stable@vger.kernel.org
Link: https://lore.kernel.org/r/174972756982.3337526.6755001617701603082.stgit@mhiramat.tok.corp.google.com
Signed-off-by: Ulf Hansson <ulf.hansson@linaro.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/mmc/host/mtk-sd.c