]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()
authorPeilin Ye <yepeilin.cs@gmail.com>
Tue, 28 Jul 2020 19:29:24 +0000 (15:29 -0400)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Jul 2020 15:02:10 +0000 (11:02 -0400)
commit3353396ca23f94bc41f4d8e441b2c1e4df549ab5
treee502dbbf069cf1c50d65f41cced3fbda1fe68345
parenta41d7aea7861ea03fb6309fbf3ea79b54f9c45e9
drm/amdgpu: Prevent kernel-infoleak in amdgpu_info_ioctl()

Compiler leaves a 4-byte hole near the end of `dev_info`, causing
amdgpu_info_ioctl() to copy uninitialized kernel stack memory to userspace
when `size` is greater than 356.

In 2015 we tried to fix this issue by doing `= {};` on `dev_info`, which
unfortunately does not initialize that 4-byte hole. Fix it by using
memset() instead.

Cc: stable@vger.kernel.org
Fixes: befcb635e773 ("drm/amdgpu: information leak in amdgpu_info_ioctl()")
Fixes: 7acade7b3a33 ("drm/amdgpu: add core driver (v4)")
Suggested-by: Dan Carpenter <dan.carpenter@oracle.com>
Reviewed-by: Christian König <christian.koenig@amd.com>
Signed-off-by: Peilin Ye <yepeilin.cs@gmail.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c