CVE-2026-139022

lib/842: reject output overflows from index and short data

Published Nov 30, 2026 CVSS n/a EPSS n/a KEV · Not listed
Description
In the Linux kernel, the following vulnerability has been resolved:

lib/842: reject output overflows from index and short data

The output length passed to sw842_decompress() is the caller's buffer
capacity. Indexed copies write 2, 4 or 8 bytes and short-data templates
write up to 7, but neither checks that capacity before writing and
decrementing p->olen.

Overwriting an undersized destination then underflows p->olen, which is
unsigned, so every later bounds check in the stream passes. Subsequent
operations keep writing past the destination, and a matching CRC lets
sw842_decompress() return success with an output length larger than the
capacity the caller supplied.

This is reachable through zram's compressed writeback path. With 842
selected, targeted corruption of the compressed data on its backing device
made a KASAN kernel report vmalloc-out-of-bounds writes in __do_index() and
sw842_decompress() when zram read the page back.

Check the remaining output before both operations and return -ENOSPC,
matching the other output-producing templates.

Analysis

AI-generated

Technical impact

An unchecked bounds check in the Linux kernel’s sw842_decompress function allows an attacker to write beyond the bounds of the destination buffer. By supplying specially crafted 842 compressed data, the function writes 2, 4 or 8 bytes for indexed copies and up to 7 bytes for short‐data templates without verifying that the caller’s buffer is large enough. This results in an unsigned underflow of the length counter and causes all subsequent bounds checks to pass, enabling continuous overwriting of memory beyond the intended destination.

Affected Systems

All Linux kernel versions that include the 842 decompression implementation, particularly those using zram’s compressed writeback path. The vulnerability can be triggered by manipulating the compressed data stored on a zram backing device.

Risk and Exploitability

Although no EPSS score or KEV listing is available, the flaw provides a memory corruption path that can lead to privilege escalation or system compromise. The attack requires the ability to influence the compressed data in a zram backing device; once executed, the kernel may crash or the attacker could gain elevated privileges. Because the exploit operates in kernel mode, it can be used for remote code execution on systems where the attacker can supply or modify zram data.

Remediation

No solution or workaround provided in the CVE record.

OpenCVE Recommended Actions

  • Update the Linux kernel to a version that includes the patch for the 842 decompression bounds checks.
  • Apply the specific commit that adds output length verification in sw842_decompress, as referenced in the provided git links.
  • Until the patch is applied, disable zram or the 842 compression format to prevent the vulnerability from being exercised.

Generated by OpenCVE AI on November 30, 2026 at 18:25 UTC.

Tracking

Sign in to view the affected projects.

Advisories

No advisories available
History
Type Values Removed Values Added
Weaknesses CWE-119
Type Values Removed Values Added
Description In the Linux kernel, the following vulnerability has been resolved: lib/842: reject output overflows from index and short data The output length passed to sw842_decompress() is the caller's buffer capacity. Indexed copies write 2, 4 or 8 bytes and short-data templates write up to 7, but neither checks that capacity before writing and decrementing p->olen. Overwriting an undersized destination then underflows p->olen, which is unsigned, so every later bounds check in the stream passes. Subsequent operations keep writing past the destination, and a matching CRC lets sw842_decompress() return success with an output length larger than the capacity the caller supplied. This is reachable through zram's compressed writeback path. With 842 selected, targeted corruption of the compressed data on its backing device made a KASAN kernel report vmalloc-out-of-bounds writes in __do_index() and sw842_decompress() when zram read the page back. Check the remaining output before both operations and return -ENOSPC, matching the other output-producing templates.
Title lib/842: reject output overflows from index and short data
First Time appeared Linux
Linux linux Kernel
CPEs cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*
Vendors & Products Linux
Linux linux Kernel
References
Weaknesses
  • CWE-119

    Improper Restriction of Operations within the Bounds of a Memory Buffer

Sources

Status
PUBLISHED
Assigner
Linux
Published
Updated
Nov 30, 2026, 1:27 PM
Reserved
Nov 30, 2026, 1:22 PM
Status
Received
Published
Nov 30, 2026, 2:18 PM
Modified
Nov 30, 2026, 2:18 PM