drm/amdgpu: check alignment on CPU page for bo map
authorXℹ Ruoyao <xry111@mengyan1223.wang>
Tue, 30 Mar 2021 15:33:34 +0000 (23:33 +0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 1 Apr 2021 01:53:38 +0000 (21:53 -0400)
commite3512fb67093fabdf27af303066627b921ee9bd8
tree2aca66059fe370eaab15213dbecfcdf237ef788e
parent566c6e25f957ebdb0b6e8073ee291049118f47fb
drm/amdgpu: check alignment on CPU page for bo map

The page table of AMDGPU requires an alignment to CPU page so we should
check ioctl parameters for it.  Return -EINVAL if some parameter is
unaligned to CPU page, instead of corrupt the page table sliently.

Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Xi Ruoyao <xry111@mengyan1223.wang>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
Cc: stable@vger.kernel.org
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c