{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-38162",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T04:51:23.990Z",
        "datePublished": "2025-07-03T08:36:03.731Z",
        "dateUpdated": "2026-08-05T11:59:56.562Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T11:59:56.562Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\nnetfilter: nft_set_pipapo: prevent overflow in lookup table allocation\n\nWhen calculating the lookup table size, ensure the following\nmultiplication does not overflow:\n\n- desc->field_len[] maximum value is U8_MAX multiplied by\n  NFT_PIPAPO_GROUPS_PER_BYTE(f) that can be 2, worst case.\n- NFT_PIPAPO_BUCKETS(f->bb) is 2^8, worst case.\n- sizeof(unsigned long), from sizeof(*f->lt), lt in\n  struct nft_pipapo_field.\n\nThen, use check_mul_overflow() to multiply by bucket size and then use\ncheck_add_overflow() to the alignment for avx2 (if needed). Finally, add\nlt_size_check_overflow() helper and use it to consolidate this.\n\nWhile at it, replace leftover allocation using the GFP_KERNEL to\nGFP_KERNEL_ACCOUNT for consistency, in pipapo_resize()."
                }
            ],
            "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 allocation is reached only through nftables set creation and element insertion via the nfnetlink netlink socket (NFT_MSG_NEWSET/NFT_MSG_NEWSETELEM), which requires local system access. Per kernel scoring guidance, netfilter/nftables netlink paths are Local.\nAC:L - Every input that feeds the overflowing expression — field count, per-field length via NFTA_SET_DESC_CONCAT, group-bit width, and the rule count that drives bsize — is chosen directly by the attacker, with no race to win and no memory layout or victim state outside their control. The attack is deterministic and repeatable.\nPR:L - nfnetlink_rcv() enforces only netlink_net_capable(skb, CAP_NET_ADMIN), which is namespace-relative, so any unprivileged local user obtains it with unshare -Urn and can then create pipapo sets and insert elements. This is Low, not High, since no real root in the init namespace is needed.\nUI:N - The attacker performs the whole sequence themselves through netlink syscalls; no victim needs to open a file, mount a filesystem, or take any other action.\nS:U - The integer overflow and the resulting memory corruption are both confined to the kernel's own security authority, with no crossing of a VM, IOMMU, or sandbox boundary. This is a standard in-kernel privilege-escalation shape.\nC:H - The undersized lookup table is subsequently indexed by pipapo_bucket_set() and by the AVX2/generic lookup routines using the un-truncated groups/buckets/bsize geometry, producing out-of-bounds reads of adjacent kernel memory that can be observed through set matching results and element dumps. Heap corruption of this kind is treated as enabling arbitrary read.\nI:H - After the wrap, pipapo_resize()'s memcpy loop and every __set_bit() in pipapo_insert() write beyond the allocation, giving a controlled out-of-bounds heap write into adjacent objects. An OOB write of this form is exploitable for control-flow hijacking or arbitrary modification of kernel structures.\nA:H - Writing past the end of a kvzalloc()'d region corrupts neighbouring allocations and slab/vmalloc metadata, reliably producing an oops or panic (immediately under KASAN or hardened allocators). Any such kernel crash is High."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/nft_set_pipapo.c"
                    ],
                    "versions": [
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "91edc076439c9e2f34b176149f1c84a47a8ec32f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "a9e757473561da93c6a4136f0e59aba91ec777fc",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "c1360ac8156c0a3f2385baef91d8d26fd9d39701",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "43fe1181f738295624696ae9ff611790edb65b5e",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "3c4287f62044a90e73a561aa05fc46e62da173da",
                            "lessThan": "4c5c6aa9967dbe55bd017bb509885928d0f31206",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "net/netfilter/nft_set_pipapo.c"
                    ],
                    "versions": [
                        {
                            "version": "5.6",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.6",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.1.167",
                            "lessThanOrEqual": "6.1.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.6.125",
                            "lessThanOrEqual": "6.6.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.12.34",
                            "lessThanOrEqual": "6.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.15.3",
                            "lessThanOrEqual": "6.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.16",
                            "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.6",
                                    "versionEndExcluding": "6.1.167"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.6.125"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.12.34"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.15.3"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.6",
                                    "versionEndExcluding": "6.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/91edc076439c9e2f34b176149f1c84a47a8ec32f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/a9e757473561da93c6a4136f0e59aba91ec777fc"
                },
                {
                    "url": "https://git.kernel.org/stable/c/c1360ac8156c0a3f2385baef91d8d26fd9d39701"
                },
                {
                    "url": "https://git.kernel.org/stable/c/43fe1181f738295624696ae9ff611790edb65b5e"
                },
                {
                    "url": "https://git.kernel.org/stable/c/4c5c6aa9967dbe55bd017bb509885928d0f31206"
                }
            ],
            "title": "netfilter: nft_set_pipapo: prevent overflow in lookup table allocation",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "x_adpType": "supplier",
                "providerMetadata": {
                    "orgId": "0b142b55-0307-4c5a-b3c9-f314f3fb7c5e",
                    "shortName": "siemens-SADP",
                    "dateUpdated": "2026-07-14T12:41:33.730Z"
                },
                "affected": [
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.6",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.5",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.6",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.5",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.6",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.5",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.6",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIMATIC S7-1500 CPU 1518F-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.5",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIPLUS S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.6",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    },
                    {
                        "vendor": "Siemens",
                        "product": "SIPLUS S7-1500 CPU 1518-4 PN/DP MFP",
                        "versions": [
                            {
                                "status": "affected",
                                "version": "V3.1.5",
                                "lessThan": "*",
                                "versionType": "custom"
                            }
                        ],
                        "defaultStatus": "unknown"
                    }
                ],
                "references": [
                    {
                        "url": "https://cert-portal.siemens.com/productcert/html/ssa-082556.html"
                    },
                    {
                        "url": "https://cert-portal.siemens.com/productcert/html/ssa-019113.html"
                    }
                ]
            }
        ]
    }
}