[PATCH v5 1/2] drm/amd: validate user pitch alignment

2018-12-30 Thread Yu Zhao
Userspace may request pitch alignment that is not supported by GPU. Some requests 32, but GPU ignores it and uses default 64 when cpp is 4. If GEM object is allocated based on the smaller alignment, GPU DMA will go out of bound. Cc: sta...@vger.kernel.org # v4.2+ Signed-off-by: Yu Zhao ---

[PATCH v5 2/2] drm/amd: validate user GEM object size

2018-12-30 Thread Yu Zhao
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