CVE-2025-37858 fs/jfs: Prevent integer overflow in AG size calculation
- Published
- Updated
- Exploit status
- No public exploit known
- Technology
- Linux KernelUbuntuDebianCloud Platforms
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.
Upgrade path
11 packages: 10 fixed.
| Package | Affected | Fixed in | Status |
|---|---|---|---|
| debian/linux(Debian 12) | < 6.1.135-1; = 6.1.27-1; = 6.1.37-1; = 6.1.38-1 +34 more | 6.1.135-1 | Fixed |
| debian/linux(Debian 13) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| debian/linux(Debian 14) | < 6.12.25-1 | 6.12.25-1 | Fixed |
| Linux kernel | < 5.4.293; < 5.10.237; < 5.15.181; < 6.1.135 +22 more | 3d8a45f87010a802aa214bf39702ca9d99cbf3ba, 5.4.293, 5.10.237, 5.15.181, 6.1.135, 6.6.88, 6.12.24, 6.13.12, 6.14.3, 6.15, 7ccf3b35274512b60ecb614e0637e76bd6f2d829, 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e, 8bb29629a5e4090e1ef7199cb42db04a52802239, 55edbf5dbf60a8195c21e92124c4028939ae16b2, 211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a, c802a6a4009f585111f903e810b3be9c6d0da329, dd07a985e2ded47b6c7d69fc93c1fe02977c8454, ec34cdf4f917cc6abd306cf091f8b8361fedac88 | Fixed |
| Microsoft azure linux | < 6.6.92.2-1 | 6.6.92.2-1 | Fixed |
| ubuntu/linux(Ubuntu 22.04) | < 5.15.0-144.157 | 5.15.0-144.157 | Fixed |
| ubuntu/linux(Ubuntu 24.04) | < 6.8.0-100.100 | 6.8.0-100.100 | Fixed |
| ubuntu/linux-kvm(Ubuntu 22.04) | < 5.15.0-1084.89 | 5.15.0-1084.89 | Fixed |
| ubuntu/linux-raspi(Ubuntu 22.04) | < 5.15.0-1083.86 | 5.15.0-1083.86 | Fixed |
| ubuntu/linux-raspi(Ubuntu 24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 | Fixed |
| debian linux | = 11.0 | No fix listed | Versions listed |
Affected products
| Product | Affected versions | Fixed in |
|---|---|---|
| Microsoft azure linux | < 6.6.92.2-1 | 6.6.92.2-1 |
| debian/linux(Debian:12) | < 6.1.135-1 | 6.1.135-1 |
| debian/linux(Debian:12) | = 6.1.106-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.106-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.112-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.115-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.119-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.123-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.124-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.128-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.129-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.133-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.27-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.37-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-2~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-3 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4 | No fix listed |
| debian/linux(Debian:12) | = 6.1.38-4~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.52-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.55-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.64-1 | No fix listed |
Show 48 more
| Product | Affected versions | Fixed in |
|---|---|---|
| debian/linux(Debian:12) | = 6.1.66-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.67-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.69-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.76-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.82-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.85-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.90-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.94-1~bpo11+1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.98-1 | No fix listed |
| debian/linux(Debian:12) | = 6.1.99-1 | No fix listed |
| debian/linux(Debian:13) | < 6.12.25-1 | 6.12.25-1 |
| debian/linux(Debian:14) | < 6.12.25-1 | 6.12.25-1 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < dd07a985e2ded47b6c7d69fc93c1fe02977c8454 | dd07a985e2ded47b6c7d69fc93c1fe02977c8454 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 8bb29629a5e4090e1ef7199cb42db04a52802239 | 8bb29629a5e4090e1ef7199cb42db04a52802239 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 3d8a45f87010a802aa214bf39702ca9d99cbf3ba | 3d8a45f87010a802aa214bf39702ca9d99cbf3ba |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 55edbf5dbf60a8195c21e92124c4028939ae16b2 | 55edbf5dbf60a8195c21e92124c4028939ae16b2 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 7ccf3b35274512b60ecb614e0637e76bd6f2d829 | 7ccf3b35274512b60ecb614e0637e76bd6f2d829 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < c802a6a4009f585111f903e810b3be9c6d0da329 | c802a6a4009f585111f903e810b3be9c6d0da329 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a | 211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < ec34cdf4f917cc6abd306cf091f8b8361fedac88 | ec34cdf4f917cc6abd306cf091f8b8361fedac88 |
| Linux kernel | >= 1da177e4c3f41524e886b7f1b8a0c1fc7321cac2, < 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e | 7fcbf789629cdb9fbf4e2172ce31136cfed11e5e |
| Linux kernel | = 2.6.12 | No fix listed |
| Linux kernel | < 5.4.293 | 5.4.293 |
| Linux kernel | < 5.10.237 | 5.10.237 |
| Linux kernel | < 5.15.181 | 5.15.181 |
| Linux kernel | < 6.1.135 | 6.1.135 |
| Linux kernel | < 6.6.88 | 6.6.88 |
| Linux kernel | < 6.12.24 | 6.12.24 |
| Linux kernel | < 6.13.12 | 6.13.12 |
| Linux kernel | < 6.14.3 | 6.14.3 |
| Linux kernel | < 6.15 | 6.15 |
| ubuntu/linux(Ubuntu:22.04) | < 5.15.0-144.157 | 5.15.0-144.157 |
| ubuntu/linux-kvm(Ubuntu:22.04) | < 5.15.0-1084.89 | 5.15.0-1084.89 |
| ubuntu/linux-raspi(Ubuntu:22.04) | < 5.15.0-1083.86 | 5.15.0-1083.86 |
| ubuntu/linux(Ubuntu:24.04) | < 6.8.0-100.100 | 6.8.0-100.100 |
| ubuntu/linux-raspi(Ubuntu:24.04) | < 6.8.0-1047.51 | 6.8.0-1047.51 |
| Linux kernel | >= 5.5, < 5.10.237 | 5.10.237 |
| Linux kernel | >= 5.11, < 5.15.181 | 5.15.181 |
| Linux kernel | >= 5.16, < 6.1.135 | 6.1.135 |
| Linux kernel | >= 6.2, < 6.6.88 | 6.6.88 |
| Linux kernel | >= 6.7, < 6.12.24 | 6.12.24 |
| Linux kernel | >= 6.13, < 6.13.12 | 6.13.12 |
| Linux kernel | >= 6.14, < 6.14.3 | 6.14.3 |
| debian linux | = 11.0 | No fix listed |
References
- MSRC Security Update Guide vendor-advisory
- kernel vendor-advisory
- Debian Security Tracker CVE-2025-37858 vendor-advisory
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- git.kernel.org patch
- lists.debian.org mailing-list third-party-advisory
- lists.debian.org mailing-list third-party-advisory
- Ubuntu CVE tracker vendor-advisory
- USN-7594-1 vendor-advisory
- USN-7594-2 vendor-advisory
- USN-7594-3 vendor-advisory
- USN-7654-1 vendor-advisory
- USN-7654-2 vendor-advisory
- USN-7654-3 vendor-advisory
- USN-7655-1 vendor-advisory
- USN-7654-4 vendor-advisory
- USN-7654-5 vendor-advisory
- USN-7686-1 vendor-advisory
- USN-7711-1 vendor-advisory
- USN-7712-1 vendor-advisory
- USN-7712-2 vendor-advisory
- USN-8028-1 vendor-advisory
- USN-8028-2 vendor-advisory
- USN-8031-1 vendor-advisory
- USN-8028-3 vendor-advisory
- USN-8028-4 vendor-advisory
- USN-8028-5 vendor-advisory
- USN-8031-2 vendor-advisory
- USN-8028-6 vendor-advisory
- USN-8031-3 vendor-advisory
- USN-8052-1 vendor-advisory
- USN-8028-7 vendor-advisory
- USN-8028-8 vendor-advisory
- USN-8052-2 vendor-advisory
- USN-8074-1 vendor-advisory
- USN-8074-2 vendor-advisory
- USN-8126-1 vendor-advisory
- www.cve.org