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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 7 Apr 2021 12:47:42 +0000 (14:47 +0200)
commit4dc52ce56d63eb7389b6ad8c204e0b8f051c426f
treef709efa33bde344f7eff7da02534b85128091efd
parentf9b3b70fd4684e1a31b2a5347726b8188afb8a26
drm/amdgpu: check alignment on CPU page for bo map

commit e3512fb67093fabdf27af303066627b921ee9bd8 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/amd/amdgpu/amdgpu_vm.c