{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2021-47317",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-05-21T14:28:16.973Z",
        "datePublished": "2024-05-21T14:35:33.212Z",
        "dateUpdated": "2026-08-05T08:47:15.685Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:47:15.685Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\npowerpc/bpf: Fix detecting BPF atomic instructions\n\nCommit 91c960b0056672 (\"bpf: Rename BPF_XADD and prepare to encode other\natomics in .imm\") converted BPF_XADD to BPF_ATOMIC and added a way to\ndistinguish instructions based on the immediate field. Existing JIT\nimplementations were updated to check for the immediate field and to\nreject programs utilizing anything more than BPF_ADD (such as BPF_FETCH)\nin the immediate field.\n\nHowever, the check added to powerpc64 JIT did not look at the correct\nBPF instruction. Due to this, such programs would be accepted and\nincorrectly JIT'ed resulting in soft lockups, as seen with the atomic\nbounds test. Fix this by looking at the correct immediate value."
                }
            ],
            "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 bug is in the powerpc64 eBPF JIT (bpf_jit_build_body) and is reached only by loading a BPF program via the local bpf() syscall (or classic SO_ATTACH_FILTER → eBPF migration), not by processing remote network input.\nAC:L - The attacker fully controls the BPF bytecode; arranging insn[0].imm == 0 so the broken insn->imm check accepts BPF_FETCH/other atomics and JITs them as plain ADD is deterministic, with no race or attacker-uncontrollable layout required.\nPR:L - Unprivileged users can load BPF_PROG_TYPE_SOCKET_FILTER when kernel.unprivileged_bpf_disabled=0 (upstream default for most of the 5.12–5.14 window before BPF_UNPRIV_DEFAULT_OFF), and even CAP_BPF-gated loading is Low (non-admin) privilege per kernel CNA BPF JIT scoring precedent.\nUI:N - The attacker loads and triggers their own crafted BPF program; no separate victim action is required.\nS:U - Impact stays in the host kernel’s BPF/JIT authority (local DoS or privilege escalation) and does not cross a VM, IOMMU, or other security-boundary.\nC:H - Incorrect JIT of BPF_FETCH leaves the src register with the attacker-controlled addend while the verifier propagates stack bounds/constants into that register, so later map/memory indexing can perform out-of-bounds reads relative to verifier assumptions.\nI:H - The same verifier/JIT mismatch turns constrained offsets into attacker-controlled ones for stores, and unsupported atomics (AND/OR/XOR/XCHG/CMPXCHG) are emitted as ADD, yielding memory corruption and potential control-flow hijack primitives.\nA:H - As documented (atomic bounds test), JITing FETCH as ADD leaves a non-zero register so a verifier-proven-dead infinite loop runs in kernel context, causing soft lockups/hangs that are Availability High."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/powerpc/net/bpf_jit_comp64.c"
                    ],
                    "versions": [
                        {
                            "version": "91c960b0056672e74627776655c926388350fa30",
                            "lessThan": "7284dab07e4d51d453cc42851fae9ec4fac6ef2f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "91c960b0056672e74627776655c926388350fa30",
                            "lessThan": "0d435b6d94b05dcfd836d758a63145aa566618e2",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "91c960b0056672e74627776655c926388350fa30",
                            "lessThan": "419ac821766cbdb9fd85872bb3f1a589df05c94c",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "arch/powerpc/net/bpf_jit_comp64.c"
                    ],
                    "versions": [
                        {
                            "version": "5.12",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "5.12",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.12.19",
                            "lessThanOrEqual": "5.12.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.13.4",
                            "lessThanOrEqual": "5.13.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.14",
                            "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.12",
                                    "versionEndExcluding": "5.12.19"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.12",
                                    "versionEndExcluding": "5.13.4"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "5.12",
                                    "versionEndExcluding": "5.14"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/7284dab07e4d51d453cc42851fae9ec4fac6ef2f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/0d435b6d94b05dcfd836d758a63145aa566618e2"
                },
                {
                    "url": "https://git.kernel.org/stable/c/419ac821766cbdb9fd85872bb3f1a589df05c94c"
                }
            ],
            "title": "powerpc/bpf: Fix detecting BPF atomic instructions",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-04T05:32:08.533Z"
                },
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://git.kernel.org/stable/c/7284dab07e4d51d453cc42851fae9ec4fac6ef2f",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/0d435b6d94b05dcfd836d758a63145aa566618e2",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/419ac821766cbdb9fd85872bb3f1a589df05c94c",
                        "tags": [
                            "x_transferred"
                        ]
                    }
                ]
            },
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "id": "CVE-2021-47317",
                                "role": "CISA Coordinator",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "version": "2.0.3",
                                "timestamp": "2024-09-10T15:39:12.722343Z"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-09-11T17:33:53.176Z"
                }
            }
        ]
    }
}