CVE-2025-37837: iommu/tegra241-cmdqv: Fix warnings due to dmam_free_coherent()
In the Linux kernel, the following vulnerability has been resolved:
iommu/tegra241-cmdqv: Fix warnings due to dmamfreecoherent()
Two WARNINGs are observed when SMMU driver rolls back upon failure: arm-smmu-v3.9.auto: Failed to register iommu arm-smmu-v3.9.auto: probe with driver arm-smmu-v3 failed with error -22 ------------[ cut here ]------------ WARNING: CPU: 5 PID: 1 at kernel/dma/mapping.c:74 dmamfreecoherent+0xc0/0xd8 Call trace: dmamfreecoherent+0xc0/0xd8 (P) tegra241vintffreelvcmdq+0x74/0x188 tegra241cmdqvremovevintf+0x60/0x148 tegra241cmdqvremove+0x48/0xc8 armsmmuimplremove+0x28/0x60 devmactionrelease+0x1c/0x40 ------------[ cut here ]------------ 128 pages are still in use! WARNING: CPU: 16 PID: 1 at mm/pagealloc.c:6902 freecontigrange+0x18c/0x1c8 Call trace: freecontigrange+0x18c/0x1c8 (P) cmarelease+0x154/0x2f0 dmafreecontiguous+0x38/0xa0 dmadirectfree+0x10c/0x248 dmafreeattrs+0x100/0x290 dmamfreecoherent+0x78/0xd8 tegra241vintffreelvcmdq+0x74/0x160 tegra241cmdqvremove+0x98/0x198 armsmmuimplremove+0x28/0x60 devmactionrelease+0x1c/0x40
This is because the LVCMDQ queue memory are managed by devres, while that dmamfreecoherent() is called in the context of devmactionrelease().
Jason pointed out that "armsmmuimplprobe() has mis-ordered the devres callbacks if ops->deviceremove() is going to be manually freeing things that probe allocated": https://lore.kernel.org/linux-iommu/20250407174408.GB1722458@nvidia.com/
In fact, tegra241cmdqvinitstructures() only allocates memory resources which means any failure that it generates would be similar to -ENOMEM, so there is no point in having that "falling back to standard SMMU" routine, as the standard SMMU would likely fail to allocate memory too.
Remove the unwind part in tegra241cmdqvinitstructures(), and return a proper error code to ask SMMU driver to call tegra241cmdqvremove() via implops->deviceremove(). Then, drop tegra241vintffreelvcmdq() since devres will take care of that.
Affected Software
Remediation
Recommended actions to resolve this vulnerability, in priority order.
- Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.12.25-1 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.12.24 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.13.12 - Upgrade
Upgrade
linux/Kernelto a version that resolves this vulnerability.Fixed in 6.14.3 - Upgrade
Upgrade
debian/linuxto a version that resolves this vulnerability.Fixed in 6.1.176-1Fixed in 6.1.190-1Fixed in 6.12.107-1Fixed in 6.12.115-2Fixed in 7.2.15-1
Event History
Frequently Asked Questions
What is the severity of CVE-2025-37837?
CVE-2025-37837 is classified with a severity that can impact system stability due to warnings in the Linux kernel iommu subsystem.
How do I fix CVE-2025-37837?
To resolve CVE-2025-37837, upgrade to the latest version of the Linux kernel where the vulnerability has been patched.
What does CVE-2025-37837 affect?
CVE-2025-37837 affects the Linux kernel, particularly the iommu driver functionality.
What are the symptoms of CVE-2025-37837?
Symptoms of CVE-2025-37837 include warnings during the registration process of the iommu subsystem.
Is CVE-2025-37837 related to a specific Linux kernel version?
CVE-2025-37837 pertains to the Linux kernel's iommu subsystem and is relevant across various kernel versions prior to the fix.