{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-37997",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:23.976Z",
        "datePublished": "2025-05-29T13:15:55.580Z",
        "dateUpdated": "2026-08-05T11:58:49.210Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:58:49.210Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: ipset: fix region locking in hash types\n\nRegion locking introduced in v5.6-rc4 contained three macros to handle\nthe region locks: ahash_bucket_start(), ahash_bucket_end() which gave\nback the start and end hash bucket values belonging to a given region\nlock and ahash_region() which should give back the region lock belonging\nto a given hash bucket. The latter was incorrect which can lead to a\nrace condition between the garbage collector and adding new elements\nwhen a hash type of set is defined with timeouts."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:H/I:H/A:H",
                        "baseScore": 7.8,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The vulnerable add/del and GC paths are driven through the ipset nfnetlink/sockopt control plane, which requires a local socket (netfilter control plane = Local per kernel scoring convention). Remote packets can drive `mtype_add()` via the `xt_set` SET target, but only when the administrator has configured such a rule, so the base score uses the self-contained local path.\nAC:L - The attacker provisions both sides of the race: they choose `hashsize >= 2048` (which is what breaks the modulo-vs-division region mapping) and a short `timeout` that pins the GC period to the `HZ/10` floor, then churn add/del indefinitely with roughly half of all operations taking the wrong region lock. No condition depends on attacker-uncontrollable state, and failed attempts are freely retriable.\nPR:L - Access is gated on `netlink_net_capable(skb, CAP_NET_ADMIN)` and `ns_capable(net->user_ns, CAP_NET_ADMIN)`, both evaluated against the network namespace's user namespace, so an unprivileged user obtains it with `unshare -Urn`; ipset state is fully per-netns, so the whole attack works inside the sandbox.\nUI:N - The attacker creates the set, generates the element churn, and the garbage collector fires automatically from a delayed work item. No victim action is involved at any point.\nS:U - The corruption is confined to the kernel heap and is exploited for privilege escalation within the same kernel security authority; no VM, IOMMU, or hypervisor boundary is crossed.\nC:H - The unserialized GC/add race yields use-after-free of hbucket objects and of extension data freed by `ip_set_ext_destroy()`, and stale resurrected buckets let freed slab contents be read back to userspace via `ipset list`, giving an arbitrary-read primitive.\nI:H - GC's shrink path can copy more used entries than `tmp->size` accounts for when a concurrent `mtype_add()` bumps `n->pos` under a different lock, producing a heap out-of-bounds write of attacker-controlled element bytes; the double `kfree_rcu()` on the same hbucket additionally corrupts the SLUB freelist, both of which are standard arbitrary-write/control-flow-hijack primitives.\nA:H - Enqueuing the same `rcu_head` twice corrupts the RCU callback list (cycle → hang in `rcu_do_batch`), and the double free plus out-of-bounds writes reliably produce slab corruption, oops, and panic."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/ipset/ip_set_hash_gen.h"
                    ],
                    "versions": [
                        {
                            "version": "5dd9488ae41070b69d2f4acb580f77db5705f9ca",
                            "lessThan": "00cfc5fad1491796942a948808afb968a0a3f35b",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "226ce0ec38316d9e3739e73a64b6b8304646c658",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "82c1eb32693bc48251d92532975e19160987e5b9",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "aa77294b0f73bb8265987591460cd25b8722c3df",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "a3dfec485401943e315c394c29afe2db8f9481d6",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "e2ab67672b2288521a6146034a971f9a82ffc5c5",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "6e002ecc1c8cfdfc866b9104ab7888da54613e59",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "f66ee0410b1c3481ee75e5db9b34547b4d582465",
                            "lessThan": "8478a729c0462273188263136880480729e9efca",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "a469bab3386aebff33c59506f3a95e35b91118fd",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5.4.24",
                            "lessThan": "5.4.294",
                            "status": "affected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.5.8",
                            "lessThan": "5.6",
                            "status": "affected",
                            "versionType": "semver"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/ipset/ip_set_hash_gen.h"
                    ],
                    "versions": [
                        {
                            "version": "5.6",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.6",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.294",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.238",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.183",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.139",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.91",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.29",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.14.7",
                            "lessThanOrEqual": "6.14.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15",
                            "lessThanOrEqual": "*",
                            "status": "unaffected",
                            "versionType": "original_commit_for_fix"
                        }
                    ]
                }
            ],
            "cpeApplicability": [
                {
                    "nodes": [
                        {
                            "operator": "OR",
                            "negate": false,
                            "cpeMatch": [
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.4.24",
                                    "versionEndExcluding": "5.4.294"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "5.10.238"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "5.15.183"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.1.139"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.6.91"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.12.29"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.14.7"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.15"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.5.8"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/00cfc5fad1491796942a948808afb968a0a3f35b"
                },
                {
                    "url": "https://git.kernel.org/stable/c/226ce0ec38316d9e3739e73a64b6b8304646c658"
                },
                {
                    "url": "https://git.kernel.org/stable/c/82c1eb32693bc48251d92532975e19160987e5b9"
                },
                {
                    "url": "https://git.kernel.org/stable/c/aa77294b0f73bb8265987591460cd25b8722c3df"
                },
                {
                    "url": "https://git.kernel.org/stable/c/a3dfec485401943e315c394c29afe2db8f9481d6"
                },
                {
                    "url": "https://git.kernel.org/stable/c/e2ab67672b2288521a6146034a971f9a82ffc5c5"
                },
                {
                    "url": "https://git.kernel.org/stable/c/6e002ecc1c8cfdfc866b9104ab7888da54613e59"
                },
                {
                    "url": "https://git.kernel.org/stable/c/8478a729c0462273188263136880480729e9efca"
                }
            ],
            "title": "netfilter: ipset: fix region locking in hash types",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://lists.debian.org/debian-lts-announce/2025/10/msg00007.html"
                    },
                    {
                        "url": "https://lists.debian.org/debian-lts-announce/2025/08/msg00010.html"
                    }
                ],
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2025-11-03T19:58:10.817Z"
                }
            }
        ]
    }
}