Skip to contentSkip to conversation

CVE-2026-90397: firmware: qcom: scm: Fix NULL dereference in IRQ handler before __scm is published

DISCUSSION Greg Kroah-Hartman 1 participant 1 message Sep 17

lore
Share & tools
lore
#0 lore raw

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

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

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

firmware: qcom: scm: Fix NULL dereference in IRQ handler before __scm is published

In qcom_scm_probe(), devm_request_threaded_irq() is called before smp_store_release(&__scm, scm). Two paths can dereference __scm before it is published, both causing a NULL pointer dereference.

The IRQ handler receives scm via its data argument but passes only wq_ctx to qcom_scm_waitq_wakeup() and qcom_scm_get_completion(), which then dereference __scm directly. Thread scm through both functions so the IRQ handler path never touches __scm.

Non-atomic SMC calls made during probe (e.g. from qcom_tzmem_init via qcom_scm_shm_bridge_enable) can return WAITQ_SLEEP, causing qcom_scm_wait_for_wq_completion() to run before __scm is published and dereference it. Add platform_set_drvdata(pdev, scm) early in probe and change qcom_scm_wait_for_wq_completion() to take the device pointer and use dev_get_drvdata() to reach scm, removing any dependency on __scm.

The Linux kernel CVE team has assigned CVE-2026-90397 to this issue.

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

	Issue introduced in 6.3 with commit 6bf32599223634294cdc6efb359ffaab1d68073c and fixed in 6.12.110 with commit b451f38cb7f5bca78484362347f039c08c94de95
	Issue introduced in 6.3 with commit 6bf32599223634294cdc6efb359ffaab1d68073c and fixed in 6.18.52 with commit 1d753df5899ec356272d08bc4718e82844e4bdf0
	Issue introduced in 6.3 with commit 6bf32599223634294cdc6efb359ffaab1d68073c and fixed in 7.2.6 with commit f312ef5026678f14caf1378c5f7fffdf667f9c81
	Issue introduced in 6.3 with commit 6bf32599223634294cdc6efb359ffaab1d68073c and fixed in 7.3-rc1 with commit 966d23c7e68ea32679275a7e3d2383181002c868

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-2026-90397

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/firmware/qcom/qcom_scm-smc.c
drivers/firmware/qcom/qcom_scm.c
drivers/firmware/qcom/qcom_scm.h

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/b451f38cb7f5bca78484362347f039c08c94de95
	https://git.kernel.org/stable/c/1d753df5899ec356272d08bc4718e82844e4bdf0
	https://git.kernel.org/stable/c/f312ef5026678f14caf1378c5f7fffdf667f9c81
	https://git.kernel.org/stable/c/966d23c7e68ea32679275a7e3d2383181002c868