{"id":"CVE-2025-37858","aliases":["CVE-2025-37858"],"related":[],"kind":"vulnerability","state":"published","title":"fs/jfs: Prevent integer overflow in AG size calculation","summary":"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.","summarySource":"cvelist","descriptions":[{"lang":"en","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.","source":"cvelist"},{"lang":"es","text":"En el kernel de Linux, se ha resuelto la siguiente vulnerabilidad: fs/jfs: Evitar el desbordamiento de enteros en el cálculo del tamaño de AG El sistema de archivos JFS calcula el tamaño del grupo de asignación (AG) usando 1 &lt;&lt; l2agsize en dbExtendFS(). Cuando l2agsize supera 31 (posible con agregados de &gt;2 TB en sistemas de 32 bits), esta operación de desplazamiento de 32 bits provoca un comportamiento indefinido y un tamaño de AG incorrecto. En arquitecturas de 32 bits: - Desplazar 1 a la izquierda por 32+ bits da como resultado 0 debido al desbordamiento de enteros - Esto crea tamaños de AG no válidos (0 o valores basura) en sbi-&gt;bmap-&gt;db_agsize - Las asignaciones de bloques posteriores harían referencia a estructuras AG no válidas - Podría conducir a: - Corrupción del sistema de archivos durante las operaciones de extensión - Fallos del kernel debido a accesos a memoria no válidos - Vulnerabilidades de seguridad mediante estructuras en disco malformadas Solución mediante la conversión a s64 antes del desplazamiento: bmp-&gt;db_agsize = (s64)1 &lt;&lt; l2agsize; Esto garantiza operaciones aritméticas de 64 bits incluso en arquitecturas de 32 bits. La conversión coincide con el tipo de dato de db_agsize (s64) y sigue patrones similares en el código de cálculo de bloques JFS. Encontrado por el Centro de Verificación de Linux (linuxtesting.org) con SVACE.","source":"nvd"}],"published":"2025-05-09T06:42:05.940Z","modified":"2026-06-17T09:15:34.747Z","severity":{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"},"severities":[{"scorer":"NVD","scheme":"CVSS:3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:N/I:N/A:H","score":5.5,"rating":"MEDIUM"}],"cwes":["CWE-190"],"affected":[{"ranges":[{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"dd07a985e2ded47b6c7d69fc93c1fe02977c8454","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"8bb29629a5e4090e1ef7199cb42db04a52802239","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"3d8a45f87010a802aa214bf39702ca9d99cbf3ba","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"55edbf5dbf60a8195c21e92124c4028939ae16b2","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"7ccf3b35274512b60ecb614e0637e76bd6f2d829","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"c802a6a4009f585111f903e810b3be9c6d0da329","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"ec34cdf4f917cc6abd306cf091f8b8361fedac88","status":"affected"},{"type":"git","introduced":"1da177e4c3f41524e886b7f1b8a0c1fc7321cac2","fixed":"7fcbf789629cdb9fbf4e2172ce31136cfed11e5e","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"2.6.12","status":"affected"},{"type":"semver","introduced":"0","fixed":"2.6.12","status":"unaffected"},{"type":"semver","introduced":"5.4.293","lastAffected":"5.4.*","status":"unaffected"},{"type":"semver","introduced":"5.10.237","lastAffected":"5.10.*","status":"unaffected"},{"type":"semver","introduced":"5.15.181","lastAffected":"5.15.*","status":"unaffected"},{"type":"semver","introduced":"6.1.135","lastAffected":"6.1.*","status":"unaffected"},{"type":"semver","introduced":"6.6.88","lastAffected":"6.6.*","status":"unaffected"},{"type":"semver","introduced":"6.12.24","lastAffected":"6.12.*","status":"unaffected"},{"type":"semver","introduced":"6.13.12","lastAffected":"6.13.*","status":"unaffected"},{"type":"semver","introduced":"6.14.3","lastAffected":"6.14.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"6.15","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"status":"affected","fixed":"5.4.293"},{"status":"affected","introduced":"5.5","fixed":"5.10.237"},{"status":"affected","introduced":"5.11","fixed":"5.15.181"},{"status":"affected","introduced":"5.16","fixed":"6.1.135"},{"status":"affected","introduced":"6.2","fixed":"6.6.88"},{"status":"affected","introduced":"6.7","fixed":"6.12.24"},{"status":"affected","introduced":"6.13","fixed":"6.13.12"},{"status":"affected","introduced":"6.14","fixed":"6.14.3"}],"vendor":"linux","product":"linux_kernel","cpe":"cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*","source":"nvd"},{"ranges":[{"status":"affected","version":"11.0"}],"vendor":"debian","product":"debian_linux","cpe":"cpe:2.3:o:debian:debian_linux:11.0:*:*:*:*:*:*:*","source":"nvd"}],"references":[{"url":"https://git.kernel.org/stable/c/dd07a985e2ded47b6c7d69fc93c1fe02977c8454","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/8bb29629a5e4090e1ef7199cb42db04a52802239","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/3d8a45f87010a802aa214bf39702ca9d99cbf3ba","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/55edbf5dbf60a8195c21e92124c4028939ae16b2","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7ccf3b35274512b60ecb614e0637e76bd6f2d829","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c802a6a4009f585111f903e810b3be9c6d0da329","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/ec34cdf4f917cc6abd306cf091f8b8361fedac88","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/7fcbf789629cdb9fbf4e2172ce31136cfed11e5e","tags":["patch"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00045.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]},{"url":"https://lists.debian.org/debian-lts-announce/2025/05/msg00030.html","tags":["mailing-list","third-party-advisory"],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2025-37858","url":"https://www.cve.org/CVERecord?id=CVE-2025-37858","licence":"CVE Terms of Use","modified":"2026-05-11T21:16:28.306Z"},{"source":"nvd","name":"NVD","id":"CVE-2025-37858","url":"https://nvd.nist.gov/vuln/detail/CVE-2025-37858","licence":"Public domain","modified":"2026-06-17T09:15:34.747Z"}],"updatedAt":"2026-11-25T22:58:57.850Z","epss":{"score":0.00314,"percentile":0.2623,"date":"2026-12-01T12:00:22.000Z"}}