{"id":"CVE-2025-40334","state":"PUBLISHED","title":"drm/amdgpu: validate userq buffer virtual address and size","description":"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.","publishedAt":"2025-12-09T04:09:51.022Z","updatedAt":"2026-08-05T12:09:41.567Z","severity":{"score":7.3,"label":"High","version":"3.1","vector":"CVSS:3.1/AV:L/AC:L/PR:L/UI:N/S:U/C:L/I:H/A:H","source":"Linux"},"assigner":"Linux","products":["Linux Linux"],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5501117d24a38dadff3dbd8d3102559b27929668","status":"affected","lessThan":"5a577de86c4a1c67ca405571d6ef84e65c6897d1","versionType":"git"},{"version":"5501117d24a38dadff3dbd8d3102559b27929668","status":"affected","lessThan":"9e46b8bb0539d7bc9a9e7b3072fa4f6082490392","versionType":"git"},{"version":"fbf136b932358da1c65eb6fedd064a33a7a96aaa","status":"affected","lessThan":"9e46b8bb0539d7bc9a9e7b3072fa4f6082490392","versionType":"git"}],"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"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.16","versionType":"semver"},{"version":"6.17.8","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"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"]}],"references":["https://git.kernel.org/stable/c/5a577de86c4a1c67ca405571d6ef84e65c6897d1","https://git.kernel.org/stable/c/9e46b8bb0539d7bc9a9e7b3072fa4f6082490392"],"weaknesses":[],"ingestedAt":"2026-10-29T20:09:09.358Z","source":{"repository":"CVEProject/cvelistV5","path":"cves/2025/40xxx/CVE-2025-40334.json","commit":"556c9d3a8cd17e218bb8e452ba7cd619a384ff47"},"raw":{"dataType":"CVE_RECORD","dataVersion":"5.2","cveMetadata":{"cveId":"CVE-2025-40334","state":"PUBLISHED","datePublished":"2025-12-09T04:09:51.022Z","dateUpdated":"2026-08-05T12:09:41.567Z","assignerShortName":"Linux","assignerOrgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateReserved":"2025-04-16T07:20:57.186Z"},"containers":{"cna":{"title":"drm/amdgpu: validate userq buffer virtual address and size","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."}],"affected":[{"vendor":"Linux","product":"Linux","defaultStatus":"unaffected","versions":[{"version":"5501117d24a38dadff3dbd8d3102559b27929668","status":"affected","lessThan":"5a577de86c4a1c67ca405571d6ef84e65c6897d1","versionType":"git"},{"version":"5501117d24a38dadff3dbd8d3102559b27929668","status":"affected","lessThan":"9e46b8bb0539d7bc9a9e7b3072fa4f6082490392","versionType":"git"},{"version":"fbf136b932358da1c65eb6fedd064a33a7a96aaa","status":"affected","lessThan":"9e46b8bb0539d7bc9a9e7b3072fa4f6082490392","versionType":"git"}],"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"]},{"vendor":"Linux","product":"Linux","defaultStatus":"affected","versions":[{"version":"6.16","status":"affected"},{"version":"0","status":"unaffected","lessThan":"6.16","versionType":"semver"},{"version":"6.17.8","status":"unaffected","lessThanOrEqual":"6.17.*","versionType":"semver"},{"version":"6.18","status":"unaffected","lessThanOrEqual":"*","versionType":"original_commit_for_fix"}],"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"]}],"references":[{"url":"https://git.kernel.org/stable/c/5a577de86c4a1c67ca405571d6ef84e65c6897d1"},{"url":"https://git.kernel.org/stable/c/9e46b8bb0539d7bc9a9e7b3072fa4f6082490392"}],"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."}]}],"providerMetadata":{"shortName":"Linux","orgId":"416baaa9-dc9f-4396-8d5f-8c081fb06d67","dateUpdated":"2026-08-05T12:09:41.567Z"},"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"}]}]}],"x_generator":{"engine":"bippy-1.2.0"}}}}}