cve.bz

CVE-2024-40979 linux linux kernel: Release of Invalid Pointer or Reference

5.5 mediumEPSS 0.3%Fix available

Medium (5.5) in linux linux kernel. EPSS 0.3% estimated probability of exploitation activity in the next 30 days.

On this page
In the Linux kernel, the following vulnerability has been resolved: wifi: ath12k: fix kernel crash during resume Currently during resume, QMI target memory is not properly handled, resulting in kernel crash in case DMA remap is not supported: BUG: Bad page state in process kworker/u16:54 pfn:36e80 page: refcount:1 mapcount:0 mapping:0000000000000000 index:0x0 pfn:0x36e80 page dumped because: nonzero _refcount Call Trace: bad_page free_page_is_bad_report __free_pages_ok __free_pages dma_direct_free dma_free_attrs ath12k_qmi_free_target_mem_chunk ath12k_qmi_msg_mem_request_cb The reason is: Once ath12k module is loaded, firmware sends memory request to host. In case DMA remap not supported, ath12k refuses the first request due to failure in allocating with large segment size: ath12k_pci 0000:04:00.0: qmi firmware request memory request ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 7077888 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 8454144 ath12k_pci 0000:04:00.0: qmi dma allocation failed (7077888 B type 1), will try later with small size ath12k_pci 0000:04:00.0: qmi delays mem_request 2 ath12k_pci 0000:04:00.0: qmi firmware request memory request Later firmware comes back with more but small segments and allocation succeeds: ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 262144 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 524288 ath12k_pci 0000:04:00.0: qmi mem seg type 4 size 65536 ath12k_pci 0000:04:00.0: qmi mem seg type 1 size 524288 Now ath12k is working. If suspend is triggered, firmware will be reloaded during resume. As same as before, firmware requests two large segments at first. In ath12k_qmi_msg_mem_request_cb() segment count and size are assigned: ab->qmi.mem_seg_count == 2 ab->qmi.target_mem[0].size == 7077888 ab->qmi.target_mem[1].size == 8454144 Then allocation failed like before and ath12k_qmi_free_target_mem_chunk() is called to free all allocated segments. Note the first segment is skipped because its v.addr is cleared due to allocation failure: chunk->v.addr = dma_alloc_coherent() Also note that this leaks that segment because it has not been freed. While freeing the second segment, a size of 8454144 is passed to dma_free_coherent(). However remember that this segment is allocated at the first time firmware is loaded, before suspend. So its real size is 524288, much smaller than 8454144. As a result kernel found we are freeing some memory which is in use and thus cras ---truncated---

Severity

CVSS 3.1

5.5 medium
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H
EPSS
0.3% (unchanged from 0.3% a week ago; 0.3% 30 days ago) estimated probability of exploitation activity in the next 30 days; 23rd percentile. Scored 2026-11-15. A forecast for this CVE across the internet, not for your own systems.
CISA's assessment (SSVC)
Exploitation: none · Automatable: no · Technical impact: partial, assessed 2024-09-10. From CISA's Vulnrichment in the CVE List: whether it is exploited, whether exploiting it can be automated, and how much control it gives.
CWEs
CWE-401 Missing Release of Memory after Effective Lifetime
CWE-763 Release of Invalid Pointer or Reference
Published
Modified
NVD analysis
Analyzed, since modified
Record from
the NVD, synced

Fix and patched versions

Ask an AI about this CVE

Show the promptExplain CVE-2024-40979 for an engineer deciding whether to act. Use https://cve.bz/api/public/cves/CVE-2024-40979?via=ask-ai-copy and https://cve.bz/cve/CVE-2024-40979?via=ask-ai-copy as the source of truth: what is affected and which versions fix it, whether it is in CISA KEV, public exploits, and its EPSS (an internet-wide 30-day estimate of exploitation activity, not a forecast for my systems). If they give no fixed versions, use the CVE record https://cveawg.mitre.org/api/cve/CVE-2024-40979 or the vendor advisory, not third-party mirrors. Tell me how to check whether I am affected and how to verify a fix. Cite the sources and say where they are uncertain.

Opens a third-party assistant; its answer is its own, not cve.bz's. The prompt holds only this CVE's id and public links.

Affected

Versions

From the CNA's record in the CVE List.

ProductAffected
Linux6.3 and later

Fixed in

ProductRelease lineFixed in
Linux6.66.6.158
Linux6.96.9.7
Linuxlater releases6.10

Linux distributions

DistributionReleasePackageFixed inAdvisory
Debian13, 14linux6.9.7-1DEBIAN-CVE-2024-40979
Ubuntu16.04:LTSlinux-hwe-edgeno fix listedUBUNTU-CVE-2024-40979
Ubuntu18.04:LTSlinux-gcp, linux-hwe, linux-oem and 12 moreno fix listedUBUNTU-CVE-2024-40979
Ubuntu20.04:LTSlinux-gke, linux-gkeop, linux-riscv and 26 moreno fix listedUBUNTU-CVE-2024-40979
Ubuntu22.04:LTSlinux-aws-6.86.8.0-1015.16~22.04.1UBUNTU-CVE-2024-40979
Ubuntu22.04:LTSlinux-gcp-6.8, linux-azure-6.86.8.0-1014.16~22.04.1UBUNTU-CVE-2024-40979
Ubuntu22.04:LTSlinux-hwe-6.86.8.0-45.45~22.04.1UBUNTU-CVE-2024-40979 USN-7029-1
Ubuntu22.04:LTSlinux-ibm-6.8, linux-oracle-6.86.8.0-1012.12~22.04.1UBUNTU-CVE-2024-40979
Ubuntu22.04:LTSlinux-nvidia-6.86.8.0-1013.14~22.04.1UBUNTU-CVE-2024-40979 USN-7005-2
Ubuntu22.04:LTSlinux-riscv, linux-aws-6.2, linux-aws-6.5 and 30 moreno fix listedUBUNTU-CVE-2024-40979
Ubuntu22.04:LTSlinux-riscv-6.8, linux-lowlatency-hwe-6.86.8.0-44.44.1~22.04.1UBUNTU-CVE-2024-40979 USN-7008-1
Ubuntu24.04:LTSlinux6.8.0-44.44UBUNTU-CVE-2024-40979 USN-6999-1
Ubuntu24.04:LTSlinux-aws6.8.0-1015.16UBUNTU-CVE-2024-40979 USN-6999-1
11 more for Ubuntu in the JSON and on Ubuntu's page.
SUSELinux Enterprise High Availability Extension 15 SP6, Linux Enterprise Live Patching 15 SP6, Linux Enterprise Module for Legacy 15 SP6 and 1 morekernel-default6.4.0-150600.23.17.1SUSE-SU-2024:2802-1
SUSELinux Enterprise Live Patching 15 SP6kernel-livepatch-SLE15-SP6-RT_Update_11-150600.1.5.1SUSE-SU-2024:2973-1
SUSELinux Enterprise Live Patching 15 SP6kernel-livepatch-SLE15-SP6_Update_31-150600.13.3.1SUSE-SU-2024:2802-1
SUSELinux Enterprise Module for Basesystem 15 SP6kernel-64kb, kernel-source, kernel-default and 1 more6.4.0-150600.23.17.1SUSE-SU-2024:2802-1
SUSELinux Enterprise Module for Basesystem 15 SP6kernel-default-base6.4.0-150600.23.17.1.150600.12.6.2SUSE-SU-2024:2802-1
SUSELinux Enterprise Module for Development Tools 15 SP6kernel-docs6.4.0-150600.23.17.3SUSE-SU-2024:2802-1
SUSELinux Enterprise Module for Development Tools 15 SP6kernel-syms, kernel-source, kernel-obs-build6.4.0-150600.23.17.1SUSE-SU-2024:2802-1
SUSELinux Enterprise Module for Public Cloud 15 SP6kernel-azure, kernel-source-azure6.4.0-150600.8.8.2SUSE-SU-2024:2896-1
SUSELinux Enterprise Module for Public Cloud 15 SP6kernel-syms-azure6.4.0-150600.8.8.1SUSE-SU-2024:2896-1
SUSELinux Micro 6.0kernel-default-base6.4.0-17.1.1.51SUSE-SU-2025:20008-1
SUSELinux Micro 6.0kernel-rt, kernel-source-rt6.4.0-9.1SUSE-SU-2025:20028-1
SUSELinux Micro 6.0kernel-source, kernel-default, kernel-kvmsmall6.4.0-18.1SUSE-SU-2025:20008-1
1 more for SUSE in the JSON and on SUSE's page.
openSUSELeap 15.6dtb-aarch64, kernel-64kb, kernel-syms and 7 more6.4.0-150600.23.17.1SUSE-SU-2024:2802-1
openSUSELeap 15.6kernel-azure, kernel-source-azure6.4.0-150600.8.8.2SUSE-SU-2024:2896-1
openSUSELeap 15.6kernel-default-base6.4.0-150600.23.17.1.150600.12.6.2SUSE-SU-2024:2802-1
openSUSELeap 15.6kernel-docs6.4.0-150600.23.17.3SUSE-SU-2024:2802-1
openSUSELeap 15.6kernel-rt, kernel-syms-rt, kernel-rt_debug and 1 more6.4.0-150600.10.5.1SUSE-SU-2024:2973-1
openSUSELeap 15.6kernel-syms-azure6.4.0-150600.8.8.1SUSE-SU-2024:2896-1
Alpaquita25, streamlinux-lts6.12.41-r0BELL-CVE-2024-40979

From the distributions' data via OSV.dev: the Debian Security Tracker; Ubuntu Security Notices © Canonical Ltd., CC BY-SA 4.0; SUSE security data, CC BY 4.0; BellSoft's OSV database, MIT. Modified: reformatted and linked to CVE records. Credits. On the distributions' own pages: Debian · Ubuntu · SUSE · openSUSE · Alpaquita.

Red Hat

Red Hat rates this Moderate.

Red Hat's statement

Red Hat Enterprise Linux is not impacted by this CVE, as the vulnerability in question does not affect the specific versions or configurations of the Linux kernel used in its distributions. This ensures that users of Red Hat Enterprise Linux are not exposed to the potential risks associated with this issue, and no further action or mitigation is necessary for systems running this operating system.

Red Hat's mitigation

Mitigation for this issue is either not available or the currently available options do not meet the Red Hat Product Security criteria comprising ease of use and deployment, applicability to widespread installation base or stability.

ProductPackageStateAdvisory
Red Hat Enterprise Linux 6kernelNot affected
Red Hat Enterprise Linux 7kernelNot affected
Red Hat Enterprise Linux 7kernel-rtNot affected
Red Hat Enterprise Linux 8kernelNot affected
Red Hat Enterprise Linux 8kernel-rtNot affected
Red Hat Enterprise Linux 9kernelNot affected
Red Hat Enterprise Linux 9kernel-rtNot affected

Contains Red Hat Security Data © Red Hat, Inc., licensed under CC BY 4.0. Source: https://access.redhat.com/security/data. Modified: reformatted. Red Hat's page for CVE-2024-40979.

References

Check your stackJSON