CVE Professor
/
All CVEs
CVE-2026-139020

CVE-2026-139020 — Linux Kernel — NONE Vulnerability

NONE CVSS 0 ⚡ EPSS 0.2% NVD

In the Linux kernel, the following vulnerability has been resolved: gfs2: reject invalid inode sizes A corrupted GFS2 image can store a dinode size that is larger than what VFS i_size can represent. gfs2_dinode_in() reads the on-disk di_size as a u64 and writes it directly into inode->i_size. If the value is larger than S64_MAX, the incore i_size becomes negative. That negative value can bypass the existing stuffed inode size check: inode->i_size > gfs2_max_stuffed_size(ip) Later, gfs2_quotad may try to sync the quota file and unstuff the quota inode. gfs2_unstuffer_folio() reads the negative i_size into an unsigned length and passes it to memcpy(), turning it into a huge copy size and triggering a out-of-bound issue. Reject dinodes whose size exceeds sb->s_maxbytes before storing the value in inode->i_size. Also make the stuffed inode check use the raw on-disk size while it is still unsigned.

In the Linux kernel, the following vulnerability has been resolved: gfs2: reject invalid inode sizes A corrupted GFS2 image can store a dinode size that is larger than what VFS i_size can represent. gfs2_dinode_in() reads the on-disk di_size as a u64 and writes it directly into inode->i_size. If the value is larger than S64_MAX, the incore i_size becomes negative. That negative value can bypass the existing stuffed inode size check: inode->i_size > gfs2_max_stuffed_size(ip) Later, gfs2_quotad may try to sync the quota file and unstuff the quota inode. gfs2_unstuffer_folio() reads the negative i_size into an unsigned length and passes it to memcpy(), turning it into a huge copy size and triggering a out-of-bound issue. Reject dinodes whose size exceeds sb->s_maxbytes before storing the value in inode->i_size. Also make the stuffed inode check use the raw on-disk size while it is still unsigned.

EPSS — Exploit Prediction Scoring System
0.2%
30-day probability
In the 14. percentile of all CVEs — higher exploitation probability than most vulnerabilities.
AI Security Analysis & Remediation

🎯 What is this vulnerability?

Technical Flaw:
This vulnerability is a Type Confusion / Integer Overflow leading to Out-of-Bounds (OOB) Memory Read/Write in the Linux kernel's GFS2 (Global File System 2) driver.

Root Cause Analysis:
1. Input Validation Failure: The function gfs2_dinode_in() reads the di_size field from the on-disk GFS2 dinode structure. This field is a 64-bit unsigned integer (u64).
2. Signedness Mismatch: The code writes this u64 value directly into inode->i_size, which is a signed 64-bit integer (s64 or loff_t).
3. Bypass of Sanity Checks: If the on-disk di_size is greater than S64_MAX (i.e., the most significant bit is set), the resulting in-memory inode->i_size becomes a negative number.
4. Logic Bypass: The existing check for "stuffed" inodes (small files stored directly in the inode) compares inode->i_size > gfs2_max_stuffed_size(ip). Since a negative number is always less than a positive maximum size, this check passes incorrectly, allowing the kernel to proceed with operations on a corrupted size value.
5. Exploitation Primitive: Later, during quota synchronization (gfs2_quotad), the function gfs2_unstuffer_folio() casts the negative i_size to an unsigned length for a memcpy() operation. A negative s64 cast to u64 results in a very large positive number (e.g., 0xFFFFFFFFFFFFFFxx). This causes memcpy to read/write far beyond the allocated buffer, leading to memory corruption.

CWE Classification:

  • CWE-190: Integer Overflow or Wraparound

  • CWE-125: Out-of-bounds Read

  • CWE-787: Out-of-bounds Write
  • CVSS Note: The provided CVSS score is 0/10 (NONE), which is technically inconsistent with the description of an OOB memory corruption issue in the kernel. Typically, such bugs are rated High or Critical (7.0–9.8) because they can lead to Denial of Service (kernel panic) or potentially Privilege Escalation if the memory corruption is controllable. The "0" score likely indicates a data entry error in the source feed or that the specific commit was assessed as having no direct external attack surface without a pre-existing corrupted filesystem. However, for security analysis, we must treat this as a High Severity local privilege escalation / DoS vector.

    ⚡ Attack Chain

    Prerequisite: The attacker must have the ability to mount a malicious GFS2 filesystem image. This typically requires:

  • Local access with permission to mount filesystems (e.g., CAP_SYS_ADMIN or root).

  • Or, a scenario where the system automatically mounts untrusted GFS2 volumes (e.g., USB drives, network shares, or container images).
  • Step 1: Discovery & Reconnaissance

    1. Identify GFS2 Usage: Check if the target system uses GFS2.
    # Check loaded modules
        lsmod | grep gfs2
    
        # Check mounted filesystems
        mount | grep gfs2
    
        # Check for GFS2 tools
        which gfs2_tool

    2. Verify Kernel Version: Ensure the kernel is vulnerable (pre-patch). The fix involves rejecting dinodes with sizes exceeding sb->s_maxbytes.

    Step 2: Exploitation (PoC Concept)

    Note: This is an illustrative PoC. Actual exploitation requires crafting a specific GFS2 image with a corrupted dinode.

    1. Craft Malicious GFS2 Image:
    * Create a GFS2 filesystem image.
    * Use a tool like gfs2_tool or a custom Python script to modify the on-disk dinode of a specific file (e.g., the quota file).
    * Set the di_size field to a value greater than S64_MAX (e.g., 0xFFFFFFFFFFFFFFFF).

    # Illustrative Python snippet to corrupt dinode size
        # Requires precise knowledge of GFS2 on-disk structure
        import struct
    
        # Assume we have a buffer representing the dinode
        # di_size is typically at a specific offset in the dinode structure
        # This is a placeholder for the actual offset
        offset_di_size = 0x10  # Example offset, must be verified against gfs2.h
        malicious_size = 0xFFFFFFFFFFFFFFFF  # > S64_MAX
    
        # Write the malicious size into the dinode buffer
        dinode_buffer[offset_di_size:offset_di_size+8] = struct.pack('<Q', malicious_size)

    2. Mount the Malicious Filesystem:

    # Mount the crafted image
        sudo mkdir /mnt/gfs2_poc
        sudo mount -t gfs2 /path/to/malicious_gfs2.img /mnt/gfs2_poc

    3. Trigger the Vulnerability:
    * The vulnerability is triggered when gfs2_quotad attempts to sync the quota file.
    * This may happen automatically upon mount if quotas are enabled, or when the quota file is accessed/modified.
    * Alternatively, an attacker with local access can trigger a quota sync by writing to a file on the GFS2 volume.

    # Trigger quota sync by writing to a file
        sudo dd if=/dev/zero of=/mnt/gfs2_poc/testfile bs=1M count=1

    4. Result:
    * gfs2_unstuffer_folio() reads the negative i_size.
    * memcpy() is called with a huge length.
    * Outcome: Kernel panic (DoS) or memory corruption leading to potential code execution.

    Step 3: Post-Exploitation

  • Denial of Service: The most likely outcome is a kernel panic, crashing the system.
  • Privilege Escalation: If the OOB write can be controlled to overwrite specific kernel structures (e.g., task_struct, cred), the attacker may escalate from a local user to root. This requires advanced exploitation techniques (e.g., heap spraying, ROP chains).
  • Data Exfiltration: If the OOB read is controllable, the attacker may read sensitive kernel memory.
  • 🌍 Real World Impact

  • Confidentiality: High (if OOB read is controllable). An attacker could read kernel memory, potentially exposing credentials, keys, or other sensitive data.
  • Integrity: High (if OOB write is controllable). An attacker could modify kernel memory, leading to arbitrary code execution or system compromise.
  • Availability: High. The most immediate impact is a kernel panic, causing a system crash and denial of service.
  • Practical Consequences:

  • Server Crashes: Systems using GFS2 for shared storage (e.g., cluster nodes) could crash, disrupting services.

  • Container Escape: If a container mounts a malicious GFS2 volume, the host kernel could be compromised.

  • Automated Mount Risks: Systems that automatically mount untrusted GFS2 volumes (e.g., USB drives) are at risk of remote code execution if an attacker can provide a malicious image.
  • 🛡️ Remediation & Mitigation

    1. Patching

  • Upgrade the Linux Kernel: Apply the patch that rejects dinodes with sizes exceeding sb->s_maxbytes.
  • Specific Commit: The fix is described as: "Reject dinodes whose size exceeds sb->s_maxbytes before storing the value in inode->i_size. Also make the stuffed inode check use the raw on-disk size while it is still unsigned."
  • Check for Patches:
  • # Check kernel version
        uname -r
    
        # Check for specific patch (example, verify with your distribution's changelog)
        git log --oneline | grep "gfs2: reject invalid inode sizes"

    2. Workarounds

  • Disable GFS2: If GFS2 is not required, unload the module or prevent mounting.
  • # Unload GFS2 module
        sudo modprobe -r gfs2
    
        # Prevent automatic mounting
        # Edit /etc/fstab to remove GFS2 entries
        # Or use udev rules to ignore GFS2 devices
  • Restrict Mounting: Limit the ability to mount GFS2 filesystems to trusted users only.
  • # Use sudoers to restrict mount commands
        # Example: Allow only root to mount GFS2
        root ALL=(ALL) /bin/mount -t gfs2
  • Disable Quotas: If possible, disable GFS2 quotas to prevent gfs2_quotad from triggering the vulnerability.
  • # Remount without quota options
        sudo mount -o remount,noquota /mnt/gfs2

    3. Detection

  • Kernel Logs: Monitor for kernel panics or OOB errors.
  • # Check dmesg for GFS2 errors
        dmesg | grep -i gfs2
    
        # Look for specific error messages
        dmesg | grep -i "out-of-bounds"
  • Filesystem Integrity: Regularly check GFS2 filesystems for corruption.
  • # Use gfs2_tool to check filesystem integrity
        sudo gfs2_tool check /dev/sdX
  • Audit Mounts: Monitor for unexpected GFS2 mounts.
  • # Use auditd to log mount events
        auditctl -w /bin/mount -p x -k gfs2_mount

    ⚠️ Urgency

    Priority: HIGH

  • CVSS Score: The provided score of 0/10 is likely incorrect. Based on the nature of the bug (OOB memory corruption in the kernel), the actual severity is High (7.0–8.8).
  • CISA KEV: Not listed, but this does not diminish the risk.
  • Exploit Complexity: Moderate. Requires crafting a malicious GFS2 image and mounting it.
  • Recommendation:
1. Immediate: Identify all systems using GFS2. 2. Short-term: Apply kernel patches as soon as available from your distribution. 3. Medium-term: Restrict GFS2 mounting to trusted sources and disable automatic mounting of untrusted volumes. 4. Long-term: Monitor for kernel updates and security advisories related to GFS2.

[🤖 CVE Professor AI Security Engine]

Target Reconnaissance Queries (FOFA & Shodan)

FOFA Query

app="Linux Linux"
CVSS Score
0 / 10 · CVSS NONE
Affected Products (2)
Linux Kernel (commit: 8db6c08e0d) Linux Kernel (6.2)
Related CVEs
9.4
CVE-2026-129109
Calico installations managed by the Tigera Operator install a FlexVolume driver (nodeagent~uds/uds) on every L
8.8
CVE-2026-105101
An OS command injection vulnerability in the ping diagnostic function (InternetState.java) in Elinktek UZ801 4
8.8
CVE-2026-118966
A missing authentication vulnerability in the SSH server of Nokia SR Linux allows an unauthenticated attacker
8.7
CVE-2026-145182
Mullvad gotatun 0.1.0 before 0.10.1 contains a denial of service vulnerability that allows unauthenticated rem
0.0
CVE-2026-132063
The 2C2P Redirect API for WooCommerce WordPress plugin through 7.0.3 does not stop processing a payment callba
0.0
CVE-2026-140849
Multiple malformed-packet handling vulnerabilities exist in a number of Nokia SR OS control-plane protocols (B
0.0
CVE-2026-141072
Rejected reason: Not a valid vulnerability.