The commit 009f401fb98b ("drm/amdgpu: move amdgpu_vm_bo_update() call into 
correct location")
unintentionally uncovered two cases of incorrect error handling, which
leads to random failures in the igt pci unplug tests.

Both of the issues follow the same pattern:
- One user thread is submitting a CS while the other is unplugging the
  device
- The VA op starts while the device is still plugged, and mid-way the
  unplug starts, causing the next (nested) drm_dev_enter() to fail with
  -ENODEV.
- Patch 1 addresses a leaked job when this race occurs.
- Patch 2 addresses a use-after-free when this race occurs.

This was uncovered by the referenced commit because the initial seq64
page table allocation only happened on the first CS instead of when the
drm fd is opened.

Benjamin Cheng (2):
  drm/amdgpu/vm: free pte update job on error
  drm/amdgpu/vm_pt: free PT on error

 drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c    | 5 ++++-
 drivers/gpu/drm/amd/amdgpu/amdgpu_vm_pt.c | 8 ++++++--
 2 files changed, 10 insertions(+), 3 deletions(-)

-- 
2.56.0

Reply via email to