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

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

CVE-2024-47701 is a use-after-free flaw in the Linux Kernel ext4 filesystem that occurs when xattr changes lead to out-of-bounds access. This article covers the 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-47701 Overview

CVE-2024-47701 is an out-of-bounds access vulnerability in the Linux kernel's ext4 filesystem driver. The flaw occurs when the system.data extended attribute (xattr) changes underneath the filesystem during an inlined directory lookup. If e_value_offs is modified by changes to the underlying block device, ext4_search_dir in fs/ext4/namei.c reads beyond allocated memory. Kernel Address Sanitizer (KASAN) classifies the resulting read as a use-after-free [CWE-416]. The issue affects multiple Linux kernel branches and has been addressed upstream and backported to stable trees.

Critical Impact

A local attacker with the ability to mount a crafted ext4 image or modify a block device can trigger kernel memory corruption, enabling denial of service or potential privilege escalation.

Affected Products

  • Linux Kernel (multiple stable branches prior to the fix commits)
  • Debian LTS distributions (addressed in January and March 2025 advisories)
  • Siemens industrial products referencing advisories SSA-265688, SSA-355557, and SSA-398330

Discovery Timeline

  • 2024-10-21 - CVE-2024-47701 published to NVD
  • 2026-10-15 - Last updated in NVD database

Technical Details for CVE-2024-47701

Vulnerability Analysis

The defect lives in the ext4 inline directory handling path. When a directory is small enough to be stored inline within the inode body, ext4 locates entries using the system.data extended attribute. The ext4_find_inline_entry function calls ext4_search_dir to walk entries using the e_value_offs field recorded in the xattr header.

If a malicious or corrupt block device mutates e_value_offs after the inode is read but before the xattr is validated, the offset points outside the inline data region. ext4_search_dir then dereferences attacker-influenced memory. KASAN reports this as a use-after-free during a symlinkat syscall path reaching lookup_one_qstr_excl and subsequently ext4_lookup.

The upstream fix calls ext4_xattr_ibody_find immediately after ext4_get_inode_loc, forcing xattr validation before any offset-based read occurs.

Root Cause

The root cause is a missing validation of the inline xattr region between inode load and directory entry search. The kernel trusted e_value_offs without re-verifying that it still pointed within the allocated inline body. Concurrent block-device modification could invalidate that assumption and produce an out-of-bounds read that KASAN surfaces as use-after-free behavior.

Attack Vector

Exploitation requires local access with privileges to mount a filesystem or to write to the block device backing an ext4 mount. An attacker crafts an ext4 image, mounts it (for example via loop0 as shown in the KASAN report), and then alters the on-disk xattr so that e_value_offs changes between validation and use. A directory lookup such as symlinkat triggers ext4_search_dir, which reads outside the inline buffer and corrupts kernel state.

The vulnerability is not remotely reachable. No public proof-of-concept exploit is listed in Exploit-DB, and the issue is not present in the CISA Known Exploited Vulnerabilities catalog.

// No verified exploit code is published for CVE-2024-47701.
// Refer to the upstream commits for the corrective patch logic.

Detection Methods for CVE-2024-47701

Indicators of Compromise

  • KASAN reports referencing use-after-free in ext4_search_dir within fs/ext4/namei.c
  • Kernel log entries noting detected capacity change on loop devices followed by ext4 lookup faults
  • Unexpected kernel oops or panic traces originating from ext4_find_inline_entry or __ext4_find_entry

Detection Strategies

  • Enable KASAN on test kernels and monitor dmesg for out-of-bounds reads inside ext4 directory functions.
  • Audit mount events for loop-mounted or user-supplied ext4 images, correlating them with subsequent kernel faults.
  • Deploy endpoint telemetry that flags unprivileged users invoking mount with untrusted filesystem images.

Monitoring Recommendations

  • Alert on kernel crash dumps containing the ext4_search_dir symbol in the backtrace.
  • Track process execution of mount, losetup, and raw block-device writes by non-root principals.
  • Forward auditd filesystem mount events into centralized logging for retrospective analysis.

How to Mitigate CVE-2024-47701

Immediate Actions Required

  • Apply the kernel update supplied by your distribution vendor as soon as it is available.
  • Restrict CAP_SYS_ADMIN and filesystem mount capabilities to trusted administrators only.
  • Disable automatic mounting of removable media and user-supplied disk images where feasible.

Patch Information

The fix is distributed across multiple stable branches. Relevant upstream commits include 2a6579e, 371d0ba, 7fc22c3, be2e9b1, c6b72f5, ccb8c18, and ea32883. Debian users should consult the Debian LTS January 2025 advisory and Debian LTS March 2025 advisory. Siemens customers should review SSA-265688, SSA-355557, and SSA-398330.

Workarounds

  • Prevent non-administrative users from mounting arbitrary ext4 images, including loop-mounted files.
  • Harden udev and systemd automount rules to require explicit administrator approval for new block devices.
  • Where kernel updates cannot be installed immediately, deploy mandatory access controls such as SELinux or AppArmor profiles that restrict mount operations.
bash
# Example: disable user mounting of filesystems via sudo policy
# /etc/sudoers.d/restrict-mount
Defaults!/bin/mount  !targetpw
%wheel ALL=(root) /bin/mount, /sbin/losetup

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.