Skip to content

Commit bb2874b

Browse files
Wei Lugregkh
authored andcommitted
drm/amdkfd: Fix error codes in kfd_get_process
[ Upstream commit e47cb82 ] Return ERR_PTR(-EINVAL) if kfd_get_process fails to find the process. This fixes kernel oopses when a child process calls KFD ioctls with a file descriptor inherited from the parent process. Signed-off-by: Wei Lu <wei.lu2@amd.com> Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com> Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com> Acked-by: Christian König <christian.koenig@amd.com> Signed-off-by: Oded Gabbay <oded.gabbay@gmail.com> Signed-off-by: Sasha Levin <alexander.levin@microsoft.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
1 parent bb9dcbf commit bb2874b

1 file changed

Lines changed: 2 additions & 0 deletions

File tree

drivers/gpu/drm/amd/amdkfd/kfd_process.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -123,6 +123,8 @@ struct kfd_process *kfd_get_process(const struct task_struct *thread)
123123
return ERR_PTR(-EINVAL);
124124

125125
process = find_process(thread);
126+
if (!process)
127+
return ERR_PTR(-EINVAL);
126128

127129
return process;
128130
}

0 commit comments

Comments
 (0)