Loading
mmc: mmci: stm32: use a buffer for unaligned DMA requests
stable inclusion from stable-v5.10.213 commit abda366ece483d9f94edecb8cadc3704ec68c434 category: bugfix bugzilla: https://gitee.com/src-openeuler/kernel/issues/I9E461 CVE: CVE-2024-26787 Reference: https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/commit/?id=abda366ece483d9f94edecb8cadc3704ec68c434 -------------------------------- [ Upstream commit 970dc9c1 ] In SDIO mode, the sg list for requests can be unaligned with what the STM32 SDMMC internal DMA can support. In that case, instead of failing, use a temporary bounce buffer to copy from/to the sg list. This buffer is limited to 1MB. But for that we need to also limit max_req_size to 1MB. It has not shown any throughput penalties for SD-cards or eMMC. Signed-off-by:Yann Gautier <yann.gautier@foss.st.com> Link: https://lore.kernel.org/r/20220328145114.334577-1-yann.gautier@foss.st.com Signed-off-by:
Ulf Hansson <ulf.hansson@linaro.org> Stable-dep-of: 6b1ba3f9040b ("mmc: mmci: stm32: fix DMA API overlapping mappings warning") Signed-off-by:
Sasha Levin <sashal@kernel.org> Signed-off-by:
Yi Yang <yiyang13@huawei.com>