]> 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, 10 Jul 2025 14:03:05 +0000 (16:03 +0200)
commit61cdd663564674ea21ceb50aa9d3697cbe9e45f9
treeee6af8d5e1d3332ec72eca0cc63586f04c2d81a4
parentb3b00e9b03d3a328869ea05f0ac02000bcb497a2
mtk-sd: Prevent memory corruption from DMA map failure

commit f5de469990f19569627ea0dd56536ff5a13beaa3 upstream.

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: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/mmc/host/mtk-sd.c