lkml.org 
[lkml]   [2018]   [Sep]   [24]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
    Patch in this message
    /
    From
    Subject[PATCH 4.9 095/111] drm/amdkfd: Fix error codes in kfd_get_process
    Date
    4.9-stable review patch.  If anyone has any objections, please let me know.

    ------------------

    From: Wei Lu <wei.lu2@amd.com>

    [ Upstream commit e47cb828eb3fca3e8999a0b9aa053dda18552071 ]

    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>
    ---
    drivers/gpu/drm/amd/amdkfd/kfd_process.c | 2 ++
    1 file changed, 2 insertions(+)

    --- a/drivers/gpu/drm/amd/amdkfd/kfd_process.c
    +++ b/drivers/gpu/drm/amd/amdkfd/kfd_process.c
    @@ -124,6 +124,8 @@ struct kfd_process *kfd_get_process(cons
    return ERR_PTR(-EINVAL);

    process = find_process(thread);
    + if (!process)
    + return ERR_PTR(-EINVAL);

    return process;
    }

    \
     
     \ /
      Last update: 2018-09-24 14:10    [W:3.661 / U:0.068 seconds]
    ©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site