{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2021-47505",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2024-05-22T06:20:56.205Z",
        "datePublished": "2024-05-24T15:01:52.088Z",
        "dateUpdated": "2026-08-05T08:48:09.163Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T08:48:09.163Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\naio: fix use-after-free due to missing POLLFREE handling\n\nsignalfd_poll() and binder_poll() are special in that they use a\nwaitqueue whose lifetime is the current task, rather than the struct\nfile as is normally the case.  This is okay for blocking polls, since a\nblocking poll occurs within one task; however, non-blocking polls\nrequire another solution.  This solution is for the queue to be cleared\nbefore it is freed, by sending a POLLFREE notification to all waiters.\n\nUnfortunately, only eventpoll handles POLLFREE.  A second type of\nnon-blocking poll, aio poll, was added in kernel v4.18, and it doesn't\nhandle POLLFREE.  This allows a use-after-free to occur if a signalfd or\nbinder fd is polled with aio poll, and the waitqueue gets freed.\n\nFix this by making aio poll handle POLLFREE.\n\nA patch by Ramji Jiyani <ramjiyani@google.com>\n(https://lore.kernel.org/r/20211027011834.2497484-1-ramjiyani@google.com)\ntried to do this by making aio_poll_wake() always complete the request\ninline if POLLFREE is seen.  However, that solution had two bugs.\nFirst, it introduced a deadlock, as it unconditionally locked the aio\ncontext while holding the waitqueue lock, which inverts the normal\nlocking order.  Second, it didn't consider that POLLFREE notifications\nare missed while the request has been temporarily de-queued.\n\nThe second problem was solved by my previous patch.  This patch then\nproperly fixes the use-after-free by handling POLLFREE in a\ndeadlock-free way.  It does this by taking advantage of the fact that\nfreeing of the waitqueue is RCU-delayed, similar to what eventpoll does."
                }
            ],
            "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 - Triggered via local syscalls (io_setup/io_submit with IOCB_CMD_POLL on a signalfd or binder fd); not reachable from the network stack or remote protocols.\nAC:L - The attacker fully controls both sides—submitting the aio poll and freeing the waitqueue (e.g. BINDER_THREAD_EXIT, or exiting a task whose sighand owns the queue while the aio context survives via CLONE_VM)—so the UAF is reliably inducible.\nPR:L - io_setup, io_submit, signalfd, and binder ioctls are available to unprivileged users; no CAP_* or root is required along the path.\nUI:N - Exploitation needs no victim action; the attacker performs all setup and teardown themselves.\nS:U - Impact is confined to the local kernel/host authority (standard kernel memory corruption / privilege escalation); it does not cross a VM, IOMMU, or other security boundary.\nC:H - Use-after-free on the waitqueue object enables reclaim and controlled contents, which can be leveraged for arbitrary kernel memory disclosure.\nI:H - The same UAF is exploitable for heap spray and arbitrary write / control-flow hijacking in the kernel, enabling integrity compromise and code execution.\nA:H - Accessing the freed waitqueue lock or structure causes kernel oops/panic even without a full exploit, so availability impact is high."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/aio.c",
                        "include/uapi/asm-generic/poll.h"
                    ],
                    "versions": [
                        {
                            "version": "2c14fa838cbefc23cf1c73ca167ed85b274b2913",
                            "lessThan": "321fba81ec034f88aea4898993c1bf15605c023f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "2c14fa838cbefc23cf1c73ca167ed85b274b2913",
                            "lessThan": "4105e6a128e8a98455dfc9e6dbb2ab0c33c4497f",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "2c14fa838cbefc23cf1c73ca167ed85b274b2913",
                            "lessThan": "47ffefd88abfffe8a040bcc1dd0554d4ea6f7689",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "2c14fa838cbefc23cf1c73ca167ed85b274b2913",
                            "lessThan": "60d311f9e6381d779d7d53371f87285698ecee24",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "2c14fa838cbefc23cf1c73ca167ed85b274b2913",
                            "lessThan": "50252e4b5e989ce64555c7aef7516bdefc2fea72",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "fs/aio.c",
                        "include/uapi/asm-generic/poll.h"
                    ],
                    "versions": [
                        {
                            "version": "4.18",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "4.18",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "4.19.221",
                            "lessThanOrEqual": "4.19.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.4.165",
                            "lessThanOrEqual": "5.4.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.10.85",
                            "lessThanOrEqual": "5.10.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.15.8",
                            "lessThanOrEqual": "5.15.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "5.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": "4.18",
                                    "versionEndExcluding": "4.19.221"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.18",
                                    "versionEndExcluding": "5.4.165"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.18",
                                    "versionEndExcluding": "5.10.85"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.18",
                                    "versionEndExcluding": "5.15.8"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "4.18",
                                    "versionEndExcluding": "5.16"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/321fba81ec034f88aea4898993c1bf15605c023f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/4105e6a128e8a98455dfc9e6dbb2ab0c33c4497f"
                },
                {
                    "url": "https://git.kernel.org/stable/c/47ffefd88abfffe8a040bcc1dd0554d4ea6f7689"
                },
                {
                    "url": "https://git.kernel.org/stable/c/60d311f9e6381d779d7d53371f87285698ecee24"
                },
                {
                    "url": "https://git.kernel.org/stable/c/50252e4b5e989ce64555c7aef7516bdefc2fea72"
                }
            ],
            "title": "aio: fix use-after-free due to missing POLLFREE handling",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        },
        "adp": [
            {
                "metrics": [
                    {
                        "other": {
                            "type": "ssvc",
                            "content": {
                                "timestamp": "2024-06-14T18:37:27.922309Z",
                                "id": "CVE-2021-47505",
                                "options": [
                                    {
                                        "Exploitation": "none"
                                    },
                                    {
                                        "Automatable": "no"
                                    },
                                    {
                                        "Technical Impact": "partial"
                                    }
                                ],
                                "role": "CISA Coordinator",
                                "version": "2.0.3"
                            }
                        }
                    }
                ],
                "title": "CISA ADP Vulnrichment",
                "providerMetadata": {
                    "orgId": "134c704f-9b21-4f2e-91b3-4a467353bcc0",
                    "shortName": "CISA-ADP",
                    "dateUpdated": "2024-07-30T15:15:43.456Z"
                }
            },
            {
                "providerMetadata": {
                    "orgId": "af854a3a-2127-422b-91ae-364da2661108",
                    "shortName": "CVE",
                    "dateUpdated": "2024-08-04T05:39:59.807Z"
                },
                "title": "CVE Program Container",
                "references": [
                    {
                        "url": "https://git.kernel.org/stable/c/321fba81ec034f88aea4898993c1bf15605c023f",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/4105e6a128e8a98455dfc9e6dbb2ab0c33c4497f",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/47ffefd88abfffe8a040bcc1dd0554d4ea6f7689",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/60d311f9e6381d779d7d53371f87285698ecee24",
                        "tags": [
                            "x_transferred"
                        ]
                    },
                    {
                        "url": "https://git.kernel.org/stable/c/50252e4b5e989ce64555c7aef7516bdefc2fea72",
                        "tags": [
                            "x_transferred"
                        ]
                    }
                ]
            }
        ]
    }
}