]> git.ipfire.org Git - thirdparty/kernel/linux.git/commit
drm/amdkfd: Use memdup_array_user to copy data from/to user space at kfd ioctls
authorXiaogang Chen <xiaogang.chen@amd.com>
Tue, 16 Jun 2026 18:25:56 +0000 (13:25 -0500)
committerAlex Deucher <alexander.deucher@amd.com>
Wed, 17 Jun 2026 22:24:53 +0000 (18:24 -0400)
commit2321831d7e95d4e1abaff3ffd682be9dd45db62e
treec63a3b7226c368af754eda39d12e70597c2b163f
parent516bf737a5602875f6c28d1028967837c8edf2c0
drm/amdkfd: Use memdup_array_user to copy data from/to user space at kfd ioctls

Several kfd ioctls need transfer array data from/to user space. Kfd driver
uses kmalloc_array with user provided size. That can oversize alloc or 32-bit
wrap with hostile value. Replace it by memdup_array_user that does overflow
checking and allocates through dedicated slab caches, also physical continuous
as kmalloc.

Signed-off-by: Xiaogang Chen <xiaogang.chen@amd.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 4eca4742eb215951f9739ffe0122d179d545a7a4)
drivers/gpu/drm/amd/amdkfd/kfd_chardev.c