CVE-2022-50618
Description
In the Linux kernel, the following vulnerability has been resolved:
mmc: meson-gx: fix return value check of mmc_add_host()
mmc_add_host() may return error, if we ignore its return value, it will lead two issues: 1. The memory that allocated in mmc_alloc_host() is leaked. 2. In the remove() path, mmc_remove_host() will be called to delete device, but it's not added yet, it will lead a kernel crash because of null-ptr-deref in device_del().
Fix this by checking the return value and goto error path which will call mmc_free_host().
AI Insight
LLM-synthesized narrative grounded in this CVE's description and references.
Missing return value check of mmc_add_host() in the meson-gx MMC driver can cause memory leak and potential kernel crash on removal.
Vulnerability
In the Linux kernel's meson-gx MMC driver, the function mmc_add_host() is called without checking its return value. If this function fails, the error is silently ignored, leading to two distinct issues: a memory leak of the host structure allocated by mmc_mmc_alloc_host(), and a null-pointer dereference in the device removal path when mmc_remove_host()` attempts to delete a device that was never added [1].
Exploitation
An attacker would need to trigger a failure in mmc_add_host(), which could occur due to resource exhaustion or hardware misconfiguration. No special privileges are required beyond the ability to cause the MMC subsystem to initialize a host controller. The vulnerability is local and requires physical or physical access or the ability to manipulate the MMC subsystem state.
Impact
If exploited, the memory leak degrades system stability: the memory leak reduces available memory over time, and the null-pointer dereference in device_del() leads to a kernel crash (denial of service). There is no evidence of privilege escalation or data corruption.
Mitigation
The fix was applied in Linux kernel stable commit 42343e3c6195e934b9cb4c08b7ff84a3778d77f9, which adds a proper return value check and jumps to an error path that calls mmc_free_host() to clean up the allocated memory [1]. Users should update to a kernel version containing this commit.
AI Insight generated on May 19, 2026. Synthesized from this CVE's description and the cited reference URLs; citations are validated against the source bundle.
Affected products
1Patches
7f5506e0bbb259e11c6bb745b64b2c441171fe0cfe7aa41f342343e3c6195f5ce76aeddf090935f16f265Vulnerability mechanics
Generated on May 9, 2026. Inputs: CWE entries + fix-commit diffs from this CVE's patches. Citations validated against bundle.
References
7- git.kernel.org/stable/c/42343e3c6195e934b9cb4c08b7ff84a3778d77f9nvd
- git.kernel.org/stable/c/64b2c441171febf075bd9632aca579afda8ab9fbnvd
- git.kernel.org/stable/c/90935f16f2650ab7416fa2ffbe5c28cb39cf3f1envd
- git.kernel.org/stable/c/9e11c6bb745be4e9b325cf96031b4ea34801342dnvd
- git.kernel.org/stable/c/e0cfe7aa41f3965f5224affd88afd48c60f6ad1fnvd
- git.kernel.org/stable/c/f5506e0bbb25102bd8ef2e1a3b483a0b934e454envd
- git.kernel.org/stable/c/f5ce76aeddf01ca8f2a80fc37119388d59db7c10nvd
News mentions
0No linked articles in our index yet.