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

CVE-2024-49960: Linux Kernel ext4 Use-After-Free Vulnerability

CVE-2024-49960 is a use-after-free flaw in the Linux kernel's ext4 filesystem that occurs during failed mount operations. This article covers the technical details, affected versions, security impact, 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-49960 Overview

CVE-2024-49960 is a use-after-free vulnerability [CWE-416] in the Linux kernel's ext4 filesystem code. The flaw resides in the ext4_fill_super function and was identified by the Syzbot kernel fuzzer. When an ext4 filesystem mount fails and reaches the failed_mount3 label, ext4_stop_mmpd can trigger a read I/O failure. That failure invokes ext4_handle_error, which re-arms the s_err_report timer. The superblock info structure sbi is then freed via kfree, leaving an active timer referencing freed memory.

Critical Impact

A local attacker with the ability to trigger a failed ext4 mount can corrupt kernel memory, enabling privilege escalation or kernel code execution.

Affected Products

  • Linux kernel (multiple stable branches prior to the fix commits)
  • Debian Linux 11 (bullseye)
  • Debian LTS distributions covered by DLA announcements in January 2025 and May 2025

Discovery Timeline

  • 2024-10-21 - CVE-2024-49960 published to NVD
  • 2026-08-04 - Last updated in NVD database

Technical Details for CVE-2024-49960

Vulnerability Analysis

The vulnerability is a classic use-after-free affecting ext4 filesystem initialization. The s_err_report timer is designed to log filesystem errors on a daily cadence. During a successful mount lifecycle, del_timer_sync cancels this timer before the superblock memory is released.

On the failure path, the ordering of cleanup operations is incorrect. The code calls ext4_stop_mmpd after already preparing to free sbi. If ext4_stop_mmpd encounters a read I/O error, the kernel invokes ext4_handle_error, which schedules the s_err_report timer again. The subsequent kfree(sbi) leaves a dangling timer whose callback dereferences freed superblock memory.

The kernel's object debugging infrastructure (ODEBUG) detected this issue during Syzbot fuzzing. Exploitation requires local access and the capability to mount a crafted ext4 image, giving an attacker control over kernel heap state after the free.

Root Cause

The root cause is improper ordering of resource teardown in the ext4 mount failure path. The s_err_report timer can be re-armed by error handling that runs after del_timer_sync, breaking the invariant that the timer is inactive before the superblock is freed.

Attack Vector

Exploitation is local. An attacker needs the ability to initiate a mount of an attacker-controlled ext4 filesystem image, which commonly requires CAP_SYS_ADMIN in the mount namespace or physical access to removable media that is auto-mounted. The malformed image must trigger the specific failure path at failed_mount3 while also provoking a read I/O error inside ext4_stop_mmpd. Successful exploitation produces a use-after-free condition in kernel memory that can be leveraged for privilege escalation.

The fix moves the del_timer_sync call for s_err_report to after ext4_stop_mmpd completes, ensuring any late re-arming of the timer is still cancelled before kfree(sbi) executes. See the upstream patch commits for the exact code change.

Detection Methods for CVE-2024-49960

Indicators of Compromise

  • Kernel log messages containing ODEBUG warnings referencing s_err_report or ext4_fill_super
  • Unexpected kernel oops or panic traces following a failed mount -t ext4 operation
  • Repeated mount failures of attacker-supplied ext4 images from unprivileged containers or user namespaces

Detection Strategies

  • Monitor /var/log/kern.log and dmesg for KASAN or ODEBUG reports naming ext4 functions
  • Audit syscall telemetry for mount operations targeting ext4 with non-standard sources, especially from unprivileged processes
  • Correlate mount failures with subsequent kernel instability or anomalous process privilege changes

Monitoring Recommendations

  • Enable kernel auditing (auditd) rules for mount and umount syscalls with ext4 filesystem types
  • Collect kernel ring buffer output centrally and alert on use-after-free or slab-use-after-free signatures
  • Track package versions of linux-image-* across the fleet to confirm patched kernels are deployed

How to Mitigate CVE-2024-49960

Immediate Actions Required

Patch Information

The upstream fix cancels the s_err_report timer after ext4_stop_mmpd runs, closing the window in which the timer can be re-armed. Patched commits are available at Kernel Patch Commit 0ce160c5, Kernel Patch Commit 22e9b83f, Kernel Patch Commit 7aac0c17, Kernel Patch Commit 9203817b, Kernel Patch Commit b8556958, Kernel Patch Commit cf3196e5, and Kernel Patch Commit fa78fb51.

Workarounds

  • Restrict CAP_SYS_ADMIN and disable unprivileged user namespaces where feasible to prevent arbitrary ext4 mounts
  • Disable automatic mounting of removable media on multi-user systems until the kernel is patched
  • Block mounting of untrusted ext4 images in container runtimes by enforcing seccomp and AppArmor profiles that deny the mount syscall
bash
# Example: disable unprivileged user namespaces on Debian/Ubuntu
sudo sysctl -w kernel.unprivileged_userns_clone=0
echo 'kernel.unprivileged_userns_clone=0' | sudo tee /etc/sysctl.d/99-disable-userns.conf

# Verify the running kernel version after patching
uname -r
dpkg -l | grep linux-image

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.