{"id":"CVE-2026-99871","aliases":["CVE-2026-99871"],"related":[],"kind":"vulnerability","state":"published","title":"drm/amdgpu: guard VCE/UVD sched entity teardown on failed probe","summary":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdgpu: guard VCE/UVD sched entity teardown on failed probe\n\nSince commit 037b98a2312e (\"drm/amdgpu: move UVD and VCE sched entity\ninit after sched init\"), drm_sched_entity_init() for the VCE and UVD\nkernel entities runs in the scheduler-init phase, well after the\nIP-block sw_init phase has allocated the vcpu_bos.\n\nIf probe fails between the two phases, amdgpu_device_fini_sw() still\nruns the per-IP sw_fini callbacks for blocks that did complete\nsw_init. Both amdgpu_vce_sw_fini() and amdgpu_uvd_sw_fini() then call\ndrm_sched_entity_destroy() on an entity that was never initialized:\nentity->rq is NULL and drm_sched_entity_flush() dereferences it,\noopsing in whatever context drove the failed probe.\n\nThe hole was latent-but-safe until commit 2df5efb45425 (\"drm/sched:\nRemove redundant entity->rq initialization and checks\") removed the\nif (!entity->rq) early return that commit 1decbf6bb0b4 (\"drm/sched:\nFix entities with 0 rqs.\") had put in drm_sched_entity_flush(), on the\ngrounds that entity->rq can never be NULL. That holds only for\nentities that completed drm_sched_entity_init() — not for the\nnever-initialized entity this teardown path reaches.\n\nObserved on real hardware: MI50 (Vega20, VCE 4.0 / UVD 7.2) behind a\nThunderbolt link — a pciehp presence/link-change event re-probes the\ndevice; when the re-probe fails (-EINVAL here), the cleanup path\nNULL-derefs inside drm_sched_entity_flush() in the pciehp IRQ thread\nand takes the whole machine down (panic_on_oops, EFI pstore capture).\nReproduced twice on 7.3-rc5, 2026-10-06 and 2026-10-09, identical\nsignature; the faulting instruction is `mov (%rax),%r15` on rax =\nentity->rq == NULL, i.e. `sched = entity->rq->sched`:\n\n  BUG: kernel NULL pointer dereference\n  RIP: drm_sched_entity_flush+0x34/0x2d0 [gpu_sched]\n  drm_sched_entity_destroy\n  amdgpu_vce_sw_fini\n  vce_v4_0_sw_fini\n  amdgpu_device_fini_sw\n  ...\n  pciehp_configure_device\n  pciehp_handle_presence_or_link_change\n\nGuard the entity teardown on entity->rq, which is set only by\ndrm_sched_entity_init(). amdgpu_ring_fini() already self-guards via\nthe rings[] registration, and the vcpu_bo/firmware cleanup still runs\nas before.\n\nv2: retarget Fixes: at commit 2df5efb45425 (\"drm/sched: Remove\nredundant entity->rq initialization and checks\") — the !entity->rq\ncheck from commit 1decbf6bb0b4 (\"drm/sched: Fix entities with 0\nrqs.\") that Alex pointed to was removed by it in the 7.3 window,\nso this is a regression there, not a pre-existing hole.\n\n(cherry picked from commit 3ad55d18f468fa81be725301d1e138ecd5148e6a)","summarySource":"cvelist","descriptions":[{"lang":"en","text":"In the Linux kernel, the following vulnerability has been resolved:\n\ndrm/amdgpu: guard VCE/UVD sched entity teardown on failed probe\n\nSince commit 037b98a2312e (\"drm/amdgpu: move UVD and VCE sched entity\ninit after sched init\"), drm_sched_entity_init() for the VCE and UVD\nkernel entities runs in the scheduler-init phase, well after the\nIP-block sw_init phase has allocated the vcpu_bos.\n\nIf probe fails between the two phases, amdgpu_device_fini_sw() still\nruns the per-IP sw_fini callbacks for blocks that did complete\nsw_init. Both amdgpu_vce_sw_fini() and amdgpu_uvd_sw_fini() then call\ndrm_sched_entity_destroy() on an entity that was never initialized:\nentity->rq is NULL and drm_sched_entity_flush() dereferences it,\noopsing in whatever context drove the failed probe.\n\nThe hole was latent-but-safe until commit 2df5efb45425 (\"drm/sched:\nRemove redundant entity->rq initialization and checks\") removed the\nif (!entity->rq) early return that commit 1decbf6bb0b4 (\"drm/sched:\nFix entities with 0 rqs.\") had put in drm_sched_entity_flush(), on the\ngrounds that entity->rq can never be NULL. That holds only for\nentities that completed drm_sched_entity_init() — not for the\nnever-initialized entity this teardown path reaches.\n\nObserved on real hardware: MI50 (Vega20, VCE 4.0 / UVD 7.2) behind a\nThunderbolt link — a pciehp presence/link-change event re-probes the\ndevice; when the re-probe fails (-EINVAL here), the cleanup path\nNULL-derefs inside drm_sched_entity_flush() in the pciehp IRQ thread\nand takes the whole machine down (panic_on_oops, EFI pstore capture).\nReproduced twice on 7.3-rc5, 2026-10-06 and 2026-10-09, identical\nsignature; the faulting instruction is `mov (%rax),%r15` on rax =\nentity->rq == NULL, i.e. `sched = entity->rq->sched`:\n\n  BUG: kernel NULL pointer dereference\n  RIP: drm_sched_entity_flush+0x34/0x2d0 [gpu_sched]\n  drm_sched_entity_destroy\n  amdgpu_vce_sw_fini\n  vce_v4_0_sw_fini\n  amdgpu_device_fini_sw\n  ...\n  pciehp_configure_device\n  pciehp_handle_presence_or_link_change\n\nGuard the entity teardown on entity->rq, which is set only by\ndrm_sched_entity_init(). amdgpu_ring_fini() already self-guards via\nthe rings[] registration, and the vcpu_bo/firmware cleanup still runs\nas before.\n\nv2: retarget Fixes: at commit 2df5efb45425 (\"drm/sched: Remove\nredundant entity->rq initialization and checks\") — the !entity->rq\ncheck from commit 1decbf6bb0b4 (\"drm/sched: Fix entities with 0\nrqs.\") that Alex pointed to was removed by it in the 7.3 window,\nso this is a regression there, not a pre-existing hole.\n\n(cherry picked from commit 3ad55d18f468fa81be725301d1e138ecd5148e6a)","source":"cvelist"}],"published":"2026-11-30T13:17:50.239Z","modified":"2026-11-30T14:20:21.343Z","severities":[],"cwes":[],"affected":[{"ranges":[{"type":"git","introduced":"2df5efb45425b48fbf5a3c1f36a686af26871009","fixed":"4a7b3618f6b9b1718da0aed7d237eca13823dcec","status":"affected"},{"type":"git","introduced":"2df5efb45425b48fbf5a3c1f36a686af26871009","fixed":"c3fed6272bb4771a849c33c781af99afa90e90ad","status":"affected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"},{"ranges":[{"version":"7.3","status":"affected"},{"type":"semver","introduced":"0","fixed":"7.3","status":"unaffected"},{"type":"semver","introduced":"7.3.4","lastAffected":"7.3.*","status":"unaffected"},{"type":"original_commit_for_fix","introduced":"7.4-rc1","lastAffected":"*","status":"unaffected"}],"vendor":"Linux","product":"Linux","repo":"https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git","source":"cvelist"}],"references":[{"url":"https://git.kernel.org/stable/c/4a7b3618f6b9b1718da0aed7d237eca13823dcec","tags":[],"sources":["cvelist","nvd"]},{"url":"https://git.kernel.org/stable/c/c3fed6272bb4771a849c33c781af99afa90e90ad","tags":[],"sources":["cvelist","nvd"]}],"credits":[],"assigner":"Linux","sources":[{"source":"cvelist","name":"CVE List","id":"CVE-2026-99871","url":"https://www.cve.org/CVERecord?id=CVE-2026-99871","licence":"CVE Terms of Use","modified":"2026-11-30T13:17:50.239Z"},{"source":"nvd","name":"NVD","id":"CVE-2026-99871","url":"https://nvd.nist.gov/vuln/detail/CVE-2026-99871","licence":"Public domain","modified":"2026-11-30T14:20:21.343Z"}],"updatedAt":"2026-11-30T14:33:17.206Z","epss":{"score":0.00198,"percentile":0.10109,"date":"2026-12-01T12:00:22.000Z"}}