Skip to main content
Vulnerability Database/CVE-2024-57798

CVE-2024-57798: Linux Kernel Use-After-Free Vulnerability

CVE-2024-57798 is a use-after-free flaw in the Linux Kernel's DisplayPort MST topology manager that can lead to NULL pointer dereference. This article covers technical details, affected versions, and mitigation strategies.

Published:

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

CVE-2024-57798 Overview

CVE-2024-57798 is a use-after-free vulnerability in the Linux kernel's DisplayPort Multi-Stream Transport (DP MST) subsystem. The flaw resides in the drm_dp_mst_handle_up_req() function within the Direct Rendering Manager (DRM) driver. A race condition between threads can cause the mst_primary pointer to be freed while concurrently dereferenced, leading to a NULL pointer dereference or use-after-free condition. The vulnerability affects Linux kernel versions through 6.13-rc1 and is tracked under [CWE-416] (Use After Free) and [CWE-476] (NULL Pointer Dereference).

Critical Impact

Local attackers with low privileges can trigger memory corruption in kernel space, potentially leading to privilege escalation, denial of service, or arbitrary code execution in kernel context.

Affected Products

  • Linux Kernel (multiple stable branches prior to patched commits)
  • Linux Kernel 6.13-rc1
  • Debian LTS distributions shipping affected kernel versions

Discovery Timeline

  • 2025-01-11 - CVE-2024-57798 published to NVD
  • 2026-06-17 - Last updated in NVD database

Technical Details for CVE-2024-57798

Vulnerability Analysis

The vulnerability exists in the DRM DP MST topology manager, which handles DisplayPort Multi-Stream Transport messages for display hubs and daisy-chained monitors. When one thread processes an incoming MST up request through drm_dp_mst_handle_up_req(), another thread can concurrently tear down the MST topology by calling drm_dp_mst_topology_mgr_set_mst(false). The teardown path frees the mst_primary structure and sets drm_dp_mst_topology_mgr::mst_primary to NULL.

The handler function reads and uses mst_primary without holding a reference. If the teardown executes between the read and subsequent dereference, the handler operates on freed memory. This classifies as both a use-after-free [CWE-416] and NULL pointer dereference [CWE-476] depending on timing.

The upstream fix acquires a reference to mst_primary for the duration of its use within drm_dp_mst_handle_up_req(). A follow-up revision (v2) also ensures the request structure is correctly freed when reference acquisition fails.

Root Cause

The root cause is missing reference counting on a shared pointer accessed across threads. The handler assumed mst_primary would remain valid for the duration of request processing, but the teardown path could invalidate it at any time. This is a classic lifetime management bug in concurrent kernel code.

Attack Vector

Exploitation requires local access with low privileges. An attacker with the ability to interact with the DRM subsystem, typically through a graphics device file such as /dev/dri/card0, can trigger MST topology operations. By racing MST up request handling against topology teardown, the attacker can induce the use-after-free condition. Successful exploitation yields kernel-mode memory corruption suitable for privilege escalation.

No public proof-of-concept exploit is currently available, and the vulnerability is not listed in the CISA Known Exploited Vulnerabilities catalog.

Detection Methods for CVE-2024-57798

Indicators of Compromise

  • Unexpected kernel oops or panic messages referencing drm_dp_mst_handle_up_req in dmesg or /var/log/kern.log
  • KASAN (Kernel Address Sanitizer) reports flagging use-after-free in the drm/dp_mst subsystem
  • Unexplained graphics subsystem crashes correlated with display hotplug events on systems with MST hubs

Detection Strategies

  • Inventory running Linux kernel versions against the patched commits (9735d40, ce55818, e54b000, f61b2e5) to identify vulnerable hosts
  • Monitor kernel logs for repeated DRM MST faults, which may indicate exploitation attempts or instability
  • Deploy endpoint telemetry that captures kernel crash signatures and unprivileged process behavior preceding kernel faults

Monitoring Recommendations

  • Enable kernel audit logging for processes accessing DRM device nodes under /dev/dri/
  • Correlate local privilege escalation attempts with kernel subsystem crashes on multi-user or shared Linux systems
  • Track package manager updates to confirm distribution kernels are receiving the backported fix

How to Mitigate CVE-2024-57798

Immediate Actions Required

  • Apply the patched Linux kernel from your distribution vendor as soon as updates become available
  • Prioritize patching on multi-user systems, shared workstations, and virtualization hosts where local attackers may exist
  • Review the Debian LTS Announcement for distribution-specific guidance

Patch Information

The fix is upstream in the Linux kernel across the following commits: Kernel Git Commit 9735d40, Kernel Git Commit ce55818, Kernel Git Commit e54b000, and Kernel Git Commit f61b2e5. The patch holds a reference to mst_primary while the handler uses it and safely frees the request when the reference cannot be acquired.

Workarounds

  • Restrict access to DRM device nodes under /dev/dri/ to trusted users and processes using group permissions and udev rules
  • Where DisplayPort MST functionality is not required, consider disabling or blacklisting MST-capable configurations through kernel command-line parameters
  • Limit the ability of untrusted users to execute code on systems with physical DisplayPort MST hardware until patches are deployed
bash
# Verify kernel version and installed patch level
uname -r

# Debian/Ubuntu: apply latest kernel security update
sudo apt update && sudo apt upgrade linux-image-$(uname -r | sed 's/.*-//')

# RHEL/Fedora: apply latest kernel security update
sudo dnf update kernel

# Restrict DRM device access to the video group
sudo chown root:video /dev/dri/card*
sudo chmod 0660 /dev/dri/card*

Disclaimer: This content was generated using AI. While we strive for accuracy, please verify critical information with official sources.

Sources: National Vulnerability Database, CISA KEV, Exploit-DB

Experience the Most Advanced Cybersecurity Platform

See how the world’s most intelligent, autonomous cybersecurity platform can protect your organization today and into the future.