mmc: mmc_spi: fix error handling in mmc_spi_probe()
Linux
Affected versions
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
Linux
| Product | Affected | Fixed in |
|---|---|---|
| Linux Linux |
| No fix yet |
| Linux Linux |
|
|
In the Linux kernel, the following vulnerability has been resolved:
mmc: mmc_spi: fix error handling in mmc_spi_probe()
If mmc_add_host() fails, it doesn't need to call mmc_remove_host(), or it will cause null-ptr-deref, because of deleting a not added device in mmc_remove_host().
To fix this, goto label 'fail_glue_init', if mmc_add_host() fails, and change the label 'fail_add_host' to 'fail_gpiod_request'.
From the CVE record · Linux
The Linux kernel's mmc_spi_probe() error handling can dereference a null pointer if mmc_add_host() fails, because it then calls mmc_remove_host() for a device that was not added. The input does not specify whether an attacker can trigger this failure or what access or user interaction would be required.
Engineers running the Linux kernel should check whether their builds include the affected mmc_spi code; affected versions are not specified.