diff mbox

drm/amdgpu: information leak in amdgpu_info_ioctl()

Message ID 20150728155129.GC25739@mwanda (mailing list archive)
State New, archived
Headers show

Commit Message

Dan Carpenter July 28, 2015, 3:51 p.m. UTC
We recently changed the drm_amdgpu_info_device struct so now there is
a 4 byte hole at the end.  We need to initialize it so we don't disclose
secret information from the stack.

Fixes: fa92754e9c47 ('drm/amdgpu: add VCE harvesting instance query')
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Comments

Alex Deucher July 29, 2015, 1:41 a.m. UTC | #1
On Tue, Jul 28, 2015 at 11:51 AM, Dan Carpenter
<dan.carpenter@oracle.com> wrote:
> We recently changed the drm_amdgpu_info_device struct so now there is
> a 4 byte hole at the end.  We need to initialize it so we don't disclose
> secret information from the stack.
>
> Fixes: fa92754e9c47 ('drm/amdgpu: add VCE harvesting instance query')
> Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>

Applied.  thanks!

Alex

>
> diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> index d9de73a..81d60a9 100644
> --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
> @@ -423,7 +423,7 @@ static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
>                 return n ? -EFAULT : 0;
>         }
>         case AMDGPU_INFO_DEV_INFO: {
> -               struct drm_amdgpu_info_device dev_info;
> +               struct drm_amdgpu_info_device dev_info = {};
>                 struct amdgpu_cu_info cu_info;
>
>                 dev_info.device_id = dev->pdev->device;
> _______________________________________________
> dri-devel mailing list
> dri-devel@lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/dri-devel
diff mbox

Patch

diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
index d9de73a..81d60a9 100644
--- a/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
+++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_kms.c
@@ -423,7 +423,7 @@  static int amdgpu_info_ioctl(struct drm_device *dev, void *data, struct drm_file
 		return n ? -EFAULT : 0;
 	}
 	case AMDGPU_INFO_DEV_INFO: {
-		struct drm_amdgpu_info_device dev_info;
+		struct drm_amdgpu_info_device dev_info = {};
 		struct amdgpu_cu_info cu_info;
 
 		dev_info.device_id = dev->pdev->device;