Skip to contentSkip to conversation

CVE-2023-54204: mmc: sunplus: fix return value check of mmc_add_host()

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Dec 30, 2025

lore
Share & tools
lore
#0 lore raw

From: Greg Kroah-Hartman <[email protected]>

Description
===========

In the Linux kernel, the following vulnerability has been resolved:

mmc: sunplus: fix return value check of mmc_add_host()

mmc_add_host() may return error, if we ignore its return value,
1. the memory allocated in mmc_alloc_host() will be leaked
2. null-ptr-deref will happen when calling mmc_remove_host() in remove function spmmc_drv_remove() because deleting not added device.

Fix this by checking the return value of mmc_add_host(). Moreover, I fixed the error handling path of spmmc_drv_probe() to clean up.

The Linux kernel CVE team has assigned CVE-2023-54204 to this issue.

Affected and fixed versions
===========================

	Issue introduced in 6.2 with commit 4e268fed8b1861616af28f9cfb4eed8ca5d7af6c and fixed in 6.4.12 with commit 741a951f41929f39cae70c66d86d0754d3129d0a
	Issue introduced in 6.2 with commit 4e268fed8b1861616af28f9cfb4eed8ca5d7af6c and fixed in 6.5 with commit dce6d8f985fa1ef5c2af47f4f86ea65511b78656

Please see https://www.kernel.org for a full list of currently supported kernel versions by the kernel community.

Unaffected versions might change over time as fixes are backported to older supported kernel versions. The official CVE entry at

	https://cve.org/CVERecord/?id=CVE-2023-54204

will be updated if fixes are backported, please check that for the most up to date information about this issue.

Affected files
==============

The file(s) affected by this issue are:
drivers/mmc/host/sunplus-mmc.c

Mitigation
==========

The Linux kernel CVE team recommends that you update to the latest stable kernel version for this, and many other bugfixes. Individual changes are never tested alone, but rather are part of a larger kernel release. Cherry-picking individual commits is not recommended or supported by the Linux kernel community at all. If however, updating to the latest release is impossible, the individual changes to resolve this issue can be found at these commits:

	https://git.kernel.org/stable/c/741a951f41929f39cae70c66d86d0754d3129d0a
	https://git.kernel.org/stable/c/dce6d8f985fa1ef5c2af47f4f86ea65511b78656