{"id":"CVE-2025-37858","published":"2025-05-09T06:42:05Z","modified":"2026-05-11T21:16:28Z","title":"fs/jfs: Prevent integer overflow in AG size calculation","vendor":"Linux","product":"Linux","tier":"tail","description":{"text":"In the Linux kernel, the following vulnerability has been resolved:\n\nfs/jfs: Prevent integer overflow in AG size calculation\n\nThe JFS filesystem calculates allocation group (AG) size using 1 <<\nl2agsize in dbExtendFS(). When l2agsize exceeds 31 (possible with >2TB\naggregates on 32-bit systems), this 32-bit shift operation causes undefined\nbehavior and improper AG sizing.\n\nOn 32-bit architectures:\n- Left-shifting 1 by 32+ bits results in 0 due to integer overflow\n- This creates invalid AG sizes (0 or garbage values) in\nsbi->bmap->db_agsize\n- Subsequent block allocations would reference invalid AG structures\n- Could lead to:\n  - Filesystem corruption during extend operations\n  - Kernel crashes due to invalid memory accesses\n  - Security vulnerabilities via malformed on-disk structures\n\nFix by casting to s64 before shifting:\nbmp->db_agsize = (s64)1 << l2agsize;\n\nThis ensures 64-bit arithmetic even on 32-bit architectures. The cast\nmatches the data type of db_agsize (s64) and follows similar patterns in\nJFS block calculation code.\n\nFound by Linux Verification Center (linuxtesting.org) with SVACE.","provenance":"source","from":"CVE.org"},"cvss":null,"epss":{"score":0.00309,"percentile":0.16194,"provenance":"source"},"cwes":[],"references":[{"url":"https://git.kernel.org/stable/c/dd07a985e2ded47b6c7d69fc93c1fe02977c8454","tags":[]},{"url":"https://git.kernel.org/stable/c/8bb29629a5e4090e1ef7199cb42db04a52802239","tags":[]},{"url":"https://git.kernel.org/stable/c/3d8a45f87010a802aa214bf39702ca9d99cbf3ba","tags":[]},{"url":"https://git.kernel.org/stable/c/55edbf5dbf60a8195c21e92124c4028939ae16b2","tags":[]},{"url":"https://git.kernel.org/stable/c/7ccf3b35274512b60ecb614e0637e76bd6f2d829","tags":[]},{"url":"https://git.kernel.org/stable/c/c802a6a4009f585111f903e810b3be9c6d0da329","tags":[]},{"url":"https://git.kernel.org/stable/c/211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a","tags":[]},{"url":"https://git.kernel.org/stable/c/ec34cdf4f917cc6abd306cf091f8b8361fedac88","tags":[]},{"url":"https://git.kernel.org/stable/c/7fcbf789629cdb9fbf4e2172ce31136cfed11e5e","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html","tags":[]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","tags":[]}],"priority":{"score":3.2,"factors":[{"name":"EPSS percentile","points":3.24}]},"vendorSlug":"linux","affectedVersions":[{"vendor":"Linux","product":"Linux","versions":[">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < dd07a985e2ded47b6c7d69fc93c1fe02977c8454",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 8bb29629a5e4090e1ef7199cb42db04a52802239",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 3d8a45f87010a802aa214bf39702ca9d99cbf3ba",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 55edbf5dbf60a8195c21e92124c4028939ae16b2",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 7ccf3b35274512b60ecb614e0637e76bd6f2d829",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < c802a6a4009f585111f903e810b3be9c6d0da329",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < ec34cdf4f917cc6abd306cf091f8b8361fedac88",">= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e"]},{"vendor":"Linux","product":"Linux","versions":["2.6.12"]}],"euvd":{"id":"EUVD-2025-14134","exploited":false,"provenance":"source"}}