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.
[
{
"id": "CVE-2025-37858-09c2103f",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@dd07a985e2ded47b6c7d69fc93c1fe02977c8454",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-1cf634e9",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8bb29629a5e4090e1ef7199cb42db04a52802239",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-38570184",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@55edbf5dbf60a8195c21e92124c4028939ae16b2",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-3c9502b4",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ec34cdf4f917cc6abd306cf091f8b8361fedac88",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-40b519b7",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3d8a45f87010a802aa214bf39702ca9d99cbf3ba",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-4d82c177",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@3d8a45f87010a802aa214bf39702ca9d99cbf3ba",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-531fbd18",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7ccf3b35274512b60ecb614e0637e76bd6f2d829",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-598967da",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-8a26c834",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c802a6a4009f585111f903e810b3be9c6d0da329",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-8cadee31",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@8bb29629a5e4090e1ef7199cb42db04a52802239",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-9f75e889",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7ccf3b35274512b60ecb614e0637e76bd6f2d829",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-a93b23ef",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@c802a6a4009f585111f903e810b3be9c6d0da329",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-bd15512d",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@55edbf5dbf60a8195c21e92124c4028939ae16b2",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-c924e523",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7fcbf789629cdb9fbf4e2172ce31136cfed11e5e",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-d45e71a8",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@7fcbf789629cdb9fbf4e2172ce31136cfed11e5e",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
},
{
"id": "CVE-2025-37858-de1031a1",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@dd07a985e2ded47b6c7d69fc93c1fe02977c8454",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-de5f5738",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c",
"function": "dbExtendFS"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@ec34cdf4f917cc6abd306cf091f8b8361fedac88",
"digest": {
"length": 3840.0,
"function_hash": "318524417438004266600493987374054573387"
},
"signature_type": "Function"
},
{
"id": "CVE-2025-37858-edc68299",
"signature_version": "v1",
"deprecated": false,
"target": {
"file": "fs/jfs/jfs_dmap.c"
},
"source": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git@211ed8f5e39e61f9e4d18edd64ce8005a67a1b2a",
"digest": {
"line_hashes": [
"119932776489723326270525771727632157631",
"155053639340291214808958284763181417963",
"119412987806644580840997019176909515270",
"146178688506568232925527652846801580972"
],
"threshold": 0.9
},
"signature_type": "Line"
}
]