{
    "dataType": "CVE_RECORD",
    "dataVersion": "5.2",
    "cveMetadata": {
        "cveId": "CVE-2025-40334",
        "assignerOrgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
        "state": "PUBLISHED",
        "assignerShortName": "Linux",
        "dateReserved": "2025-04-16T07:20:57.186Z",
        "datePublished": "2025-12-09T04:09:51.022Z",
        "dateUpdated": "2026-08-05T12:09:41.567Z"
    },
    "containers": {
        "cna": {
            "providerMetadata": {
                "orgId": "416baaa9-dc9f-4396-8d5f-8c081fb06d67",
                "shortName": "Linux",
                "dateUpdated": "2026-08-05T12:09:41.567Z"
            },
            "descriptions": [
                {
                    "lang": "en",
                    "value": "In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdgpu: validate userq buffer virtual address and size\n\nIt needs to validate the userq object virtual address to\ndetermine whether it is residented in a valid vm mapping."
                }
            ],
            "metrics": [
                {
                    "cvssV3_1": {
                        "version": "3.1",
                        "vectorString": "CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H",
                        "baseScore": 7.3,
                        "baseSeverity": "HIGH"
                    },
                    "scenarios": [
                        {
                            "lang": "en",
                            "value": "AV:L - The only path to the bug is `DRM_IOCTL_AMDGPU_USERQ` on a local amdgpu DRM node (`/dev/dri/renderD*`); `amdgpu_userq_ioctl()` has no network- or bus-facing entry point.\nAC:L - A single ioctl carrying attacker-chosen `queue_va`/`queue_size`/`rptr_va`/`eop_va`/`shadow_va`/`csa_va` deterministically bypasses the missing mapping-and-size check — no race, no memory-layout dependency, and user queues are on by default on shipping RDNA3/RDNA4 parts.\nPR:L - The ioctl is `DRM_AUTH|DRM_RENDER_ALLOW`, so any unprivileged local account, container, Android app or GPU cloud tenant holding a render-node fd (the default for logged-in desktop users) can reach it; no capability or DRM master rights are required.\nUI:N - The attacker issues the ioctl directly from its own process against its own DRM fd; no action by any other user is needed.\nS:U - All effects — corrupted firmware queue state, GPU VM faults and adapter reset — occur inside the kernel/GPU-driver security authority the ioctl already belongs to; no VM, IOMMU or sandbox boundary is crossed.\nC:L - Because neither the address nor the declared size is checked against a real VM mapping, the CP fetches ring packets and MQD state from GPU memory outside the intended buffer, and the kernel-reserved `seq64` aperture mapped into every client's VM can be read, disclosing other clients' user-queue fence/timeline values; the caller's own page tables still bound the read, so it is not an arbitrary kernel-memory read.\nI:H - With no bounds check on address+size, the GPU is made to write rptr and CP context-save/shadow/CSA data outside any validated mapping, including into the globally shared `adev->seq64` BO that userspace cannot otherwise map (`AMDGPU_VA_RESERVED_TOP` blocks it) and that `amdgpu_userq_fence_signaled()` reads to decide other processes' fence state — an out-of-bounds write primitive that lets an unprivileged client forge other clients' fence completions and break dma_resv synchronization.\nA:H - Unmapped or undersized queue/rptr/eop/shadow/CSA addresses make the CP fault as soon as the queue runs, hanging the queue and driving the driver's hang detection into `drm_dev_wedged_event()` and full GPU recovery, which wedges the adapter for every process on the system; any unprivileged user can repeat it in a loop."
                        }
                    ]
                }
            ],
            "affected": [
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "unaffected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c",
                        "drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h",
                        "drivers/gpu/drm/amd/amdgpu/mes_userqueue.c"
                    ],
                    "versions": [
                        {
                            "version": "5501117d24a38dadff3dbd8d3102559b27929668",
                            "lessThan": "5a577de86c4a1c67ca405571d6ef84e65c6897d1",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "5501117d24a38dadff3dbd8d3102559b27929668",
                            "lessThan": "9e46b8bb0539d7bc9a9e7b3072fa4f6082490392",
                            "status": "affected",
                            "versionType": "git"
                        },
                        {
                            "version": "fbf136b932358da1c65eb6fedd064a33a7a96aaa",
                            "lessThan": "9e46b8bb0539d7bc9a9e7b3072fa4f6082490392",
                            "status": "affected",
                            "versionType": "git"
                        }
                    ]
                },
                {
                    "product": "Linux",
                    "vendor": "Linux",
                    "defaultStatus": "affected",
                    "repo": "https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git",
                    "programFiles": [
                        "drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c",
                        "drivers/gpu/drm/amd/amdgpu/amdgpu_userq.h",
                        "drivers/gpu/drm/amd/amdgpu/mes_userqueue.c"
                    ],
                    "versions": [
                        {
                            "version": "6.16",
                            "status": "affected"
                        },
                        {
                            "version": "0",
                            "lessThan": "6.16",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.17.8",
                            "lessThanOrEqual": "6.17.*",
                            "status": "unaffected",
                            "versionType": "semver"
                        },
                        {
                            "version": "6.18",
                            "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": "6.16",
                                    "versionEndExcluding": "6.17.8"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.16",
                                    "versionEndExcluding": "6.18"
                                },
                                {
                                    "vulnerable": true,
                                    "criteria": "cpe:2.3:o:linux:linux_kernel:*:*:*:*:*:*:*:*",
                                    "versionStartIncluding": "6.16",
                                    "versionEndExcluding": "6.18"
                                }
                            ]
                        }
                    ]
                }
            ],
            "references": [
                {
                    "url": "https://git.kernel.org/stable/c/5a577de86c4a1c67ca405571d6ef84e65c6897d1"
                },
                {
                    "url": "https://git.kernel.org/stable/c/9e46b8bb0539d7bc9a9e7b3072fa4f6082490392"
                }
            ],
            "title": "drm/amdgpu: validate userq buffer virtual address and size",
            "x_generator": {
                "engine": "bippy-1.2.0"
            }
        }
    }
}