Skip to main content

CVE-2024-57897: Vulnerability in Linux Linux

Medium
VulnerabilityCVE-2024-57897cvecve-2024-57897
Published: Wed Jan 15 2025 (01/15/2025, 13:05:49 UTC)
Source: CVE
Vendor/Project: Linux
Product: Linux

Description

In the Linux kernel, the following vulnerability has been resolved: drm/amdkfd: Correct the migration DMA map direction The SVM DMA device map direction should be set the same as the DMA unmap setting, otherwise the DMA core will report the following warning. Before finialize this solution, there're some discussion on the DMA mapping type(stream-based or coherent) in this KFD migration case, followed by https://lore.kernel.org/all/04d4ab32 -45a1-4b88-86ee-fb0f35a0ca40@amd.com/T/. As there's no dma_sync_single_for_*() in the DMA buffer accessed that because this migration operation should be sync properly and automatically. Give that there's might not be a performance problem in various cache sync policy of DMA sync. Therefore, in order to simplify the DMA direction setting alignment, let's set the DMA map direction as BIDIRECTIONAL. [ 150.834218] WARNING: CPU: 8 PID: 1812 at kernel/dma/debug.c:1028 check_unmap+0x1cc/0x930 [ 150.834225] Modules linked in: amdgpu(OE) amdxcp drm_exec(OE) gpu_sched drm_buddy(OE) drm_ttm_helper(OE) ttm(OE) drm_suballoc_helper(OE) drm_display_helper(OE) drm_kms_helper(OE) i2c_algo_bit rpcsec_gss_krb5 auth_rpcgss nfsv4 nfs lockd grace netfs xt_conntrack xt_MASQUERADE nf_conntrack_netlink xfrm_user xfrm_algo iptable_nat xt_addrtype iptable_filter br_netfilter nvme_fabrics overlay nfnetlink_cttimeout nfnetlink openvswitch nsh nf_conncount nf_nat nf_conntrack nf_defrag_ipv6 nf_defrag_ipv4 libcrc32c bridge stp llc sch_fq_codel intel_rapl_msr amd_atl intel_rapl_common snd_hda_codec_realtek snd_hda_codec_generic snd_hda_scodec_component snd_hda_codec_hdmi snd_hda_intel snd_intel_dspcfg edac_mce_amd snd_pci_acp6x snd_hda_codec snd_acp_config snd_hda_core snd_hwdep snd_soc_acpi kvm_amd sunrpc snd_pcm kvm binfmt_misc snd_seq_midi crct10dif_pclmul snd_seq_midi_event ghash_clmulni_intel sha512_ssse3 snd_rawmidi nls_iso8859_1 sha256_ssse3 sha1_ssse3 snd_seq aesni_intel snd_seq_device crypto_simd snd_timer cryptd input_leds [ 150.834310] wmi_bmof serio_raw k10temp rapl snd sp5100_tco ipmi_devintf soundcore ccp ipmi_msghandler cm32181 industrialio mac_hid msr parport_pc ppdev lp parport efi_pstore drm(OE) ip_tables x_tables pci_stub crc32_pclmul nvme ahci libahci i2c_piix4 r8169 nvme_core i2c_designware_pci realtek i2c_ccgx_ucsi video wmi hid_generic cdc_ether usbnet usbhid hid r8152 mii [ 150.834354] CPU: 8 PID: 1812 Comm: rocrtst64 Tainted: G OE 6.10.0-custom #492 [ 150.834358] Hardware name: AMD Majolica-RN/Majolica-RN, BIOS RMJ1009A 06/13/2021 [ 150.834360] RIP: 0010:check_unmap+0x1cc/0x930 [ 150.834363] Code: c0 4c 89 4d c8 e8 34 bf 86 00 4c 8b 4d c8 4c 8b 45 c0 48 8b 4d b8 48 89 c6 41 57 4c 89 ea 48 c7 c7 80 49 b4 84 e8 b4 81 f3 ff <0f> 0b 48 c7 c7 04 83 ac 84 e8 76 ba fc ff 41 8b 76 4c 49 8d 7e 50 [ 150.834365] RSP: 0018:ffffaac5023739e0 EFLAGS: 00010086 [ 150.834368] RAX: 0000000000000000 RBX: ffffffff8566a2e0 RCX: 0000000000000027 [ 150.834370] RDX: ffff8f6a8f621688 RSI: 0000000000000001 RDI: ffff8f6a8f621680 [ 150.834372] RBP: ffffaac502373a30 R08: 00000000000000c9 R09: ffffaac502373850 [ 150.834373] R10: ffffaac502373848 R11: ffffffff84f46328 R12: ffffaac502373a40 [ 150.834375] R13: ffff8f6741045330 R14: ffff8f6741a77700 R15: ffffffff84ac831b [ 150.834377] FS: 00007faf0fc94c00(0000) GS:ffff8f6a8f600000(0000) knlGS:0000000000000000 [ 150.834379] CS: 0010 DS: 0000 ES: 0000 CR0: 0000000080050033 [ 150.834381] CR2: 00007faf0b600020 CR3: 000000010a52e000 CR4: 0000000000350ef0 [ 150.834383] Call Trace: [ 150.834385] <TASK> [ 150.834387] ? show_regs+0x6d/0x80 [ 150.834393] ? __warn+0x8c/0x140 [ 150.834397] ? check_unmap+0x1cc/0x930 [ 150.834400] ? report_bug+0x193/0x1a0 [ 150.834406] ? handle_bug+0x46/0x80 [ 150.834410] ? exc_invalid_op+0x1d/0x80 [ 150.834413] ? asm_exc_invalid_op+0x1f/0x30 [ 150.834420] ? check_unmap+0x1cc/0x930 [ 150.834425] debug_dma_unmap_page+0x86/0x90 [ 150.834431] ? srso_return_thunk+0x5/0x5f [ 150.834435] ---truncated---

AI-Powered Analysis

AILast updated: 06/28/2025, 08:41:43 UTC

Technical Analysis

CVE-2024-57897 is a vulnerability identified in the Linux kernel, specifically within the Direct Rendering Manager (DRM) subsystem related to AMD's Kernel Fusion Driver (amdkfd). The issue pertains to the incorrect setting of the DMA (Direct Memory Access) map direction during migration operations involving the Shared Virtual Memory (SVM) DMA device map. The vulnerability arises because the DMA map direction was not aligned with the DMA unmap setting, leading to warnings from the DMA core about inconsistent DMA mapping. This inconsistency can cause improper synchronization of DMA buffers, potentially leading to data corruption or system instability. The patch resolves this by setting the DMA map direction to BIDIRECTIONAL to ensure alignment with the unmap operation and simplify cache synchronization policies. The vulnerability is technical and low-level, involving kernel memory management and device driver interactions, particularly affecting AMD GPU-related components in the Linux kernel. The provided kernel logs indicate warnings and potential kernel panics related to the DMA unmap checks, which could impact system reliability. No known exploits are reported in the wild, and the vulnerability requires kernel-level access to trigger, implying that exploitation would likely need local privileges or specific hardware configurations. The vulnerability affects specific Linux kernel versions identified by commit hashes, and the fix involves kernel source code changes to the DMA mapping logic in the amdkfd driver.

Potential Impact

For European organizations, the impact of CVE-2024-57897 primarily concerns systems running Linux kernels with AMD GPU hardware utilizing the amdkfd driver, such as high-performance computing clusters, data centers, and workstations involved in GPU-accelerated workloads. The vulnerability could lead to system instability, kernel warnings, or crashes during DMA migration operations, potentially causing downtime or data integrity issues in critical applications. Although no remote exploitation is indicated, local attackers or malicious insiders with kernel access could exploit this to disrupt services or cause denial of service. Organizations relying on Linux-based infrastructure with AMD GPUs for scientific computing, virtualization, or cloud services may face operational risks if unpatched. The vulnerability does not appear to directly expose confidentiality or integrity breaches but could degrade availability and reliability of affected systems. Given the widespread use of Linux in European enterprises and public sector institutions, especially in research and technology sectors, the vulnerability warrants timely patching to maintain system stability and prevent potential escalation of impact through chained exploits.

Mitigation Recommendations

European organizations should implement the following specific mitigation measures: 1) Identify all Linux systems using AMD GPUs with the amdkfd driver, particularly those running kernel versions corresponding to the affected commit hashes. 2) Apply the latest Linux kernel updates or patches that include the fix for CVE-2024-57897 as soon as they become available from trusted Linux distributions or kernel maintainers. 3) For environments where immediate patching is not feasible, consider isolating affected systems or limiting access to trusted users with kernel-level privileges to reduce exploitation risk. 4) Monitor kernel logs for DMA-related warnings or errors that may indicate attempts to trigger the vulnerability or system instability. 5) Engage with hardware and software vendors to confirm compatibility and support for patched kernel versions, ensuring no disruption to GPU-accelerated workloads. 6) Incorporate this vulnerability into vulnerability management and incident response plans, emphasizing the importance of kernel-level security hygiene and timely updates. 7) For critical infrastructure, conduct controlled testing of patched kernels to validate stability before widespread deployment.

Need more detailed analysis?Get Pro

Technical Details

Data Version
5.1
Assigner Short Name
Linux
Date Reserved
2025-01-11T14:45:42.029Z
Cisa Enriched
false
Cvss Version
null
State
PUBLISHED

Threat ID: 682d9822c4522896dcbde9dd

Added to database: 5/21/2025, 9:08:50 AM

Last enriched: 6/28/2025, 8:41:43 AM

Last updated: 8/4/2025, 6:57:58 AM

Views: 10

Actions

PRO

Updates to AI analysis are available only with a Pro account. Contact root@offseq.com for access.

Please log in to the Console to use AI analysis features.

Need enhanced features?

Contact root@offseq.com for Pro access with improved analysis and higher rate limits.

Latest Threats