Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

drm/amdgpu/userq: Do not allow userspace to trivially triger kernel warnings

Userspace can either deliberately pass in the too small num_fences, or the
required number can legitimately grow between the two calls to the userq
wait ioctl. In both cases we do not want the emit the kernel warning
backtrace since nothing is wrong with the kernel and userspace will simply
get an errno reported back. So lets simply drop the WARN_ONs.

Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Tvrtko Ursulin <tvrtko.ursulin@igalia.com>
Fixes: a292fdecd728 ("drm/amdgpu: Implement userqueue signal/wait IOCTL")
Cc: Arunpravin Paneer Selvam <Arunpravin.PaneerSelvam@amd.com>
Cc: Christian König <christian.koenig@amd.com>
Cc: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>

authored by

Tvrtko Ursulin and committed by
Alex Deucher
2c333ea5 68951e9c

+4 -4
+4 -4
drivers/gpu/drm/amd/amdgpu/amdgpu_userq_fence.c
··· 834 834 835 835 dma_resv_for_each_fence(&resv_cursor, gobj_read[i]->resv, 836 836 DMA_RESV_USAGE_READ, fence) { 837 - if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) { 837 + if (num_fences >= wait_info->num_fences) { 838 838 r = -EINVAL; 839 839 goto free_fences; 840 840 } ··· 851 851 852 852 dma_resv_for_each_fence(&resv_cursor, gobj_write[i]->resv, 853 853 DMA_RESV_USAGE_WRITE, fence) { 854 - if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) { 854 + if (num_fences >= wait_info->num_fences) { 855 855 r = -EINVAL; 856 856 goto free_fences; 857 857 } ··· 875 875 goto free_fences; 876 876 877 877 dma_fence_unwrap_for_each(f, &iter, fence) { 878 - if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) { 878 + if (num_fences >= wait_info->num_fences) { 879 879 r = -EINVAL; 880 880 dma_fence_put(fence); 881 881 goto free_fences; ··· 900 900 if (r) 901 901 goto free_fences; 902 902 903 - if (WARN_ON_ONCE(num_fences >= wait_info->num_fences)) { 903 + if (num_fences >= wait_info->num_fences) { 904 904 r = -EINVAL; 905 905 dma_fence_put(fence); 906 906 goto free_fences;