drm/amdgpu: validate user GEM object size
authorYu Zhao <yuzhao@google.com>
Mon, 7 Jan 2019 22:51:15 +0000 (15:51 -0700)
committerAlex Deucher <alexander.deucher@amd.com>
Tue, 8 Jan 2019 21:26:50 +0000 (16:26 -0500)
commitc4a32b266da7bb702e60381ca0c35eaddbc89a6c
treeaf07926e4794a778ad656fdb277b230c08db6463
parent89f23b6efef554766177bf51aa754bce14c3e7da
drm/amdgpu: validate user GEM object size

When creating frame buffer, userspace may request to attach to a
previously allocated GEM object that is smaller than what GPU
requires. Validation must be done to prevent out-of-bound DMA,
otherwise it could be exploited to reveal sensitive data.

This fix is not done in a common code path because individual
driver might have different requirement.

Cc: stable@vger.kernel.org # v4.2+
Reviewed-by: Michel Dänzer <michel.daenzer@amd.com>
Signed-off-by: Yu Zhao <yuzhao@google.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_display.c