From: Alex Deucher Date: Thu, 30 Apr 2015 15:47:03 +0000 (-0400) Subject: drm/amdgpu: memset gds_info struct in info ioctl X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=c92b90ccc20bb55a3a0bb8fcc55c18d0710f8cb7;p=GitHub%2FLineageOS%2FG12%2Fandroid_kernel_amlogic_linux-4.9.git drm/amdgpu: memset gds_info struct in info ioctl Avoids possibility that info may leak via the uninitialized _pad element. Noticed-by: Dan Carpenter Reviewed-by: Christian König Signed-off-by: Alex Deucher --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c index c271da34998d..2d50c6dbdcbb 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c @@ -345,6 +345,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file case AMDGPU_INFO_GDS_CONFIG: { struct drm_amdgpu_info_gds gds_info; + memset(&gds_info, 0, sizeof(gds_info)); gds_info.gds_gfx_partition_size = adev->gds.mem.gfx_partition_size >> AMDGPU_GDS_SHIFT; gds_info.compute_partition_size = adev->gds.mem.cs_partition_size >> AMDGPU_GDS_SHIFT; gds_info.gds_total_size = adev->gds.mem.total_size >> AMDGPU_GDS_SHIFT;