CVE-2025-37858

fs/jfs: Prevent integer overflow in AG size calculation

MEDIUM
5.5
CVSS Score
Published: May 9, 2025 at 06:42 AM UTC
Updated: June 17, 2026 at 09:15 AM UTC
2 products affected across 2 vendorsLinux KernelDebian Linux

Using Linux by Linux?

Get instant alerts when new vulnerabilities affect Linux - before attackers find them.

Real-time alertsTrack your software stackFree plan available
Severity
MEDIUM5.5
Exploit prediction
EPSS 0.3%

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.

Affected

Our own answer: ranges merged, affected separated from platform-only, with confidence and review flags.

v < 5.4.2932.6.12 ≤ v < 5.10.2372.6.12 ≤ v < 5.15.1812.6.12 ≤ v < 5.4.2932.6.12 ≤ v < 6.1.1352.6.12 ≤ v < 6.12.242.6.12 ≤ v < 6.13.122.6.12 ≤ v < 6.14.32.6.12 ≤ v < 6.152.6.12 ≤ v < 6.6.885.11 ≤ v < 5.15.1815.16 ≤ v < 6.1.1355.5 ≤ v < 5.10.2376.13 ≤ v < 6.13.126.14 ≤ v < 6.14.36.2 ≤ v < 6.6.886.7 ≤ v < 6.12.241da177e4c3f41524e886b7f1b8a0c1fc7321cac22.6.12
Vendor states this is fixed in 211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a (fixed)
Vendor states this is fixed in 3d8a45f87010a802aa214bf39702ca9d99cbf3ba (fixed)
Vendor states this is fixed in 55edbf5dbf60a8195c21e92124c4028939ae16b2 (fixed)
Vendor states this is fixed in 7ccf3b35274512b60ecb614e0637e76bd6f2d829 (fixed)
Vendor states this is fixed in 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e (fixed)
Vendor states this is fixed in 8bb29629a5e4090e1ef7199cb42db04a52802239 (fixed)
Vendor states this is fixed in c802a6a4009f585111f903e810b3be9c6d0da329 (fixed)
Vendor states this is fixed in dd07a985e2ded47b6c7d69fc93c1fe02977c8454 (fixed)
Vendor states this is fixed in ec34cdf4f917cc6abd306cf091f8b8361fedac88 (fixed)
Vendor states this is fixed in 2.6.12 (unaffected)
Vendor states this is fixed in 5.10.237 (unaffected)
Vendor states this is fixed in 5.15.181 (unaffected)
Vendor states this is fixed in 5.4.293 (unaffected)
Vendor states this is fixed in 6.1.135 (unaffected)
Vendor states this is fixed in 6.12.24 (unaffected)
Vendor states this is fixed in 6.13.12 (unaffected)
Vendor states this is fixed in 6.14.3 (unaffected)
Vendor states this is fixed in 6.15 (unaffected)
Vendor states this is fixed in 6.6.88 (unaffected)

References (11)

Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/3d8a45f87010a802aa214bf39702ca9d99cbf3ba
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/55edbf5dbf60a8195c21e92124c4028939ae16b2
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7ccf3b35274512b60ecb614e0637e76bd6f2d829
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/7fcbf789629cdb9fbf4e2172ce31136cfed11e5e
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/8bb29629a5e4090e1ef7199cb42db04a52802239
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/c802a6a4009f585111f903e810b3be9c6d0da329
Patch
Source: 416baaa9-dc9f-4396-8d5f-8c081fb06d67
https://git.kernel.org/stable/c/dd07a985e2ded47b6c7d69fc93c1fe02977c8454

CVSS

Attack Vector
LOCAL
Complexity
LOW
Privileges
LOW
User Interaction
NONE
Scope
UNCHANGED
Confidentiality
NONE
Integrity
NONE
Availability
HIGH
Vector?

Quick Info

StatusANALYZED
CWE
CWE-190

Get alerted

Stop reading CVE feeds looking for your own stack

Track the products you run and VulnTracker tells you when a new CVE affects them — with what is known about fixing it, and nothing about the rest.

Free plan, no card