]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: Fix error handling in criu_checkpoint
authorFelix Kuehling <Felix.Kuehling@amd.com>
Tue, 1 Nov 2022 19:02:48 +0000 (15:02 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 9 Nov 2022 22:57:48 +0000 (17:57 -0500)
commit2976ed43bcefba7e667aab8d440c9109207c81e3
tree0b85c10adc5206cd246f6a40d8044d4b140f87ad
parentec5aa979fb851731f673ebae7b43ef8d098a40dd
drm/amdkfd: Fix error handling in criu_checkpoint

Checkpoint BOs last. That way we don't need to close dmabuf FDs if
something else fails later. This avoids problematic access to user mode
memory in the error handling code path.

criu_checkpoint_bos has its own error handling and cleanup that does not
depend on access to user memory.

In the private data, keep BOs before the remaining objects. This is
necessary to restore things in the correct order as restoring events
depends on the events-page BO being restored first.

Fixes: 7ff0cf4b461e ("drm/amdkfd: CRIU export BOs as prime dmabuf objects")
Reported-by: Jann Horn <jannh@google.com>
CC: Rajneesh Bhardwaj <Rajneesh.Bhardwaj@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Reviewed-and-tested-by: Rajneesh Bhardwaj <rajneesh.bhardwaj@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c