5.5medium
spi: bcm-qspi: return error if neither hif_mspi nor mspi is available
- Severity
- 5.5medium CVSS:3.1 by NVD
- Exploit likelihood
- 0.21% (higher than 7% of CVEs)
- Published
- Last changed
- Assigned by
- Linux
Description
In the Linux kernel, the following vulnerability has been resolved: spi: bcm-qspi: return error if neither hif_mspi nor mspi is available If neither a "hif_mspi" nor "mspi" resource is present, the driver will just early exit in probe but still return success. Apart from not doing anything meaningful, this would then also lead to a null pointer access on removal, as platform_get_drvdata() would return NULL, which it would then try to dereference when trying to unregister the spi master. Fix this by unconditionally calling devm_ioremap_resource(), as it can handle a NULL res and will then return a viable ERR_PTR() if we get one. The "return 0;" was previously a "goto qspi_resource_err;" where then ret was returned, but since ret was still initialized to 0 at this place this was a valid conversion in 63c5395bb7a9 ("spi: bcm-qspi: Fix use-after-free on unbind"). The issue was not introduced by this commit, only made more obvious.
Affected
| Product or package | Versions | Reported by |
|---|---|---|
| Linux Linux | from fa236a7ef24048bafaeed13f68df35a819794758 before a91c34357afcfaa5307e254f22a8452550a07b34, from fa236a7ef24048bafaeed13f68df35a819794758 before d20db3c58a7f9361e370a7850ceb60dbdf62eea3, from fa236a7ef24048bafaeed13f68df35a819794758 before 398e6a015877d44327f754aeb48ff3354945c78c, from fa236a7ef24048bafaeed13f68df35a819794758 before 32b9c8f7892c19f7f5c9fed5fb410b9fd5990bb6, from fa236a7ef24048bafaeed13f68df35a819794758 before 217b6ea8cf7b819477bca597a6ae2d43d38ba283, from fa236a7ef24048bafaeed13f68df35a819794758 before d3dcdb43c872a3b967345144151a2c9bb9124c9b, from fa236a7ef24048bafaeed13f68df35a819794758 before 22ae32d80ef590d12a2364e4621f90f7c58445c7, from fa236a7ef24048bafaeed13f68df35a819794758 before 7c1f23ad34fcdace50275a6aa1e1969b41c6233f and 1 more Not affected: before 4.9, from 4.14.322 up to 4.14.*, from 4.19.291 up to 4.19.*, from 5.4.251 up to 5.4.*, from 5.10.188 up to 5.10.*, from 5.15.121 up to 5.15.* | CVE List |
| linux linux_kernel | from 4.9 before 4.14.322, from 4.15 before 4.19.291, from 4.20 before 5.4.251, from 5.5 before 5.10.188, from 5.11 before 5.15.121, from 5.16 before 6.1.39, from 6.2 before 6.4.4 | NVD |
Classification
What each source says
CVE List
In the Linux kernel, the following vulnerability has been resolved: spi: bcm-qspi: return error if neither hif_mspi nor mspi is available If neither a "hif_mspi" nor "mspi" resource is present, the driver will just early exit in probe but still return success. Apart from not doing anything meaningful, this would then also lead to a null pointer access on removal, as platform_get_drvdata() would return NULL, which it would then try to dereference when trying to unregister the spi master. Fix this by unconditionally calling devm_ioremap_resource(), as it can handle a NULL res and will then return a viable ERR_PTR() if we get one. The "return 0;" was previously a "goto qspi_resource_err;" where then ret was returned, but since ret was still initialized to 0 at this place this was a valid conversion in 63c5395bb7a9 ("spi: bcm-qspi: Fix use-after-free on unbind"). The issue was not introduced by this commit, only made more obvious.
NVD (es)
En el kernel de Linux, la siguiente vulnerabilidad ha sido resuelta: spi: bcm-qspi: devolver error si ni hif_mspi ni mspi están disponibles Si ni un recurso ’hif_mspi’ ni ’mspi’ está presente, el controlador simplemente saldrá temprano en probe pero aún así devolverá éxito. Aparte de no hacer nada significativo, esto también llevaría a un acceso de puntero nulo en la eliminación, ya que platform_get_drvdata() devolvería NULL, el cual intentaría desreferenciar al intentar anular el registro del maestro spi. Solucione esto llamando incondicionalmente a devm_ioremap_resource(), ya que puede manejar un ’res’ NULL y luego devolverá un ERR_PTR() viable si obtenemos uno. El ’return 0;’ era previamente un ’goto qspi_resource_err;’ donde luego se devolvía ’ret’, pero dado que ’ret’ todavía estaba inicializado a 0 en este lugar, esta fue una conversión válida en 63c5395bb7a9 (’spi: bcm-qspi: Solucionar uso después de liberación en desvinculación’). El problema no fue introducido por este commit, solo se hizo más obvio.
References
Sources
| Source | Record | Licence |
|---|---|---|
| CVE List | CVE-2023-53658 changed 2026-05-11 | CVE Terms of Use |
| NVD | CVE-2023-53658 changed 2026-10-28 | Public domain |