CVE-2025-37858

MEDIUM

Linux Kernel < 5.4.293 - Integer Overflow in JFS AG Size Calculation

Title source: llm
STIX 2.1

Description

In the Linux kernel, the following vulnerability has been resolved: fs/jfs: Prevent integer overflow in AG size calculation The JFS filesystem calculates allocation group (AG) size using 1 << l2agsize in dbExtendFS(). When l2agsize exceeds 31 (possible with >2TB aggregates on 32-bit systems), this 32-bit shift operation causes undefined behavior and improper AG sizing. On 32-bit architectures: - Left-shifting 1 by 32+ bits results in 0 due to integer overflow - This creates invalid AG sizes (0 or garbage values) in sbi->bmap->db_agsize - Subsequent block allocations would reference invalid AG structures - Could lead to: - Filesystem corruption during extend operations - Kernel crashes due to invalid memory accesses - Security vulnerabilities via malformed on-disk structures Fix by casting to s64 before shifting: bmp->db_agsize = (s64)1 << l2agsize; This ensures 64-bit arithmetic even on 32-bit architectures. The cast matches the data type of db_agsize (s64) and follows similar patterns in JFS block calculation code. Found by Linux Verification Center (linuxtesting.org) with SVACE.

Scores

CVSS v3 5.5
EPSS 0.0003
EPSS Percentile 9.4%
Attack Vector LOCAL
CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H

Details

CWE
CWE-190
Status published
Products (30)
debian/debian_linux 11.0
linux/Kernel 2.6.12 - 5.4.293linux
linux/Kernel 5.11.0 - 5.15.181linux
linux/Kernel 5.16.0 - 6.1.135linux
linux/Kernel 5.5.0 - 5.10.237linux
linux/Kernel 6.13.0 - 6.13.12linux
linux/Kernel 6.14.0 - 6.14.3linux
linux/Kernel 6.2.0 - 6.6.88linux
linux/Kernel 6.7.0 - 6.12.24linux
Linux/Linux < 2.6.12
... and 20 more
Published May 09, 2025
Tracked Since Feb 18, 2026