diff options
author | Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl> | 2019-01-30 02:53:21 +0100 |
---|---|---|
committer | Alex Deucher <alexander.deucher@amd.com> | 2019-02-15 11:15:37 -0500 |
commit | 021830d24ba55a578f602979274965344c8e6284 (patch) | |
tree | 5fe70a4455cea94a2b5b2385bb04cfc523a864d9 /drivers/gpu/drm/amd/amdgpu/amdgpu.h | |
parent | 2a84e48e9712ea8591a10dd59d59ccab3d54efd6 (diff) | |
download | lwn-021830d24ba55a578f602979274965344c8e6284.tar.gz lwn-021830d24ba55a578f602979274965344c8e6284.zip |
drm/amdgpu: Check if fd really is an amdgpu fd.
Otherwise we interpret the file private data as drm & amdgpu data
while it might not be, possibly allowing one to get memory corruption.
Signed-off-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Diffstat (limited to 'drivers/gpu/drm/amd/amdgpu/amdgpu.h')
-rw-r--r-- | drivers/gpu/drm/amd/amdgpu/amdgpu.h | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu.h b/drivers/gpu/drm/amd/amdgpu/amdgpu.h index 9efa681d0878..8d0d7f3dd5fb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu.h +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu.h @@ -411,6 +411,8 @@ struct amdgpu_fpriv { struct amdgpu_ctx_mgr ctx_mgr; }; +int amdgpu_file_to_fpriv(struct file *filp, struct amdgpu_fpriv **fpriv); + int amdgpu_ib_get(struct amdgpu_device *adev, struct amdgpu_vm *vm, unsigned size, struct amdgpu_ib *ib); void amdgpu_ib_free(struct amdgpu_device *adev, struct amdgpu_ib *ib, |