media: info leak in __media_device_enum_links()
Subsystems (2)
PATCH 1/1 media: info leak in __media_device_enum_links()
These structs have holes and reserved struct members which aren't cleared. I've added a memset() so we don't leak stack information.
Signed-off-by Dan Carpenter <[email protected]>
drivers/media/media-device.c +3 -0
@@ -139,6 +139,8 @@ static long __media_device_enum_links(struct media_device *mdev,for (p =0 ; p < entity->num_pads; p++) {struct media_pad_desc pad; + +memset (&pad,0 ,sizeof (pad));media_device_kpad_to_upad (&entity->pads[p], &pad);if (copy_to_user (&links->pads[p], &pad,sizeof (pad)))return -EFAULT ;
@@ -156,6 +158,7 @@ static long __media_device_enum_links(struct media_device *mdev,if (entity->links[l].source->entity != entity)continue ; +memset (&link,0 ,sizeof (link));media_device_kpad_to_upad (entity->links[l].source, &link.source); media_device_kpad_to_upad(entity->links[l].sink,
Ping?
regards,
dan carpenter
Quoted 26 lines · Dan Carpenter
These structs have holes and reserved struct members which aren't cleared. I've added a
memset()so we don't leak stack information.Signed-off-by Dan Carpenter <[email protected]>drivers/media/media-device.c +3
-0@@ -139,6 +139,8 @@ static long __media_device_enum_links(struct media_device *mdev,for (p =0 ; p < entity->num_pads; p++) {struct media_pad_desc pad; + +memset (&pad,0 ,sizeof (pad));media_device_kpad_to_upad (&entity->pads[p], &pad);if (copy_to_user (&links->pads[p], &pad,sizeof (pad)))return -EFAULT ;@@ -156,6 +158,7 @@ static long __media_device_enum_links(struct media_device *mdev,if (entity->links[l].source->entity != entity)continue ; +memset (&link,0 ,sizeof (link));media_device_kpad_to_upad (entity->links[l].source, &link.source); media_device_kpad_to_upad(entity->links[l].sink,
Laurent Pinchart
Acked-byHi Dan,
Quoted 1 line · On Friday 31 May 2013 15:24:45 Dan Carpenter wrote:
Ping?
Oops, sorry for having missed the patch.
Quoted 5 lines · Dan Carpenter
Quoted 4 lines
These structs have holes and reserved struct members which aren't cleared. I've added a
memset()so we don't leak stack information.Signed-off-by Dan Carpenter <[email protected]>
Acked-by Laurent Pinchart <[email protected]>
I've taken the patch in my tree, Added a "CC: [email protected]" and issued a pull request.
Quoted 31 lines
Quoted 31 lines
drivers/media/media-device.c +0
-0@@ -139,6 +139,8 @@ static long __media_device_enum_links(struct
media_device*mdev,>drivers/media/media-device.c +2
-0for (p =0 ; p < entity->num_pads; p++) {struct media_pad_desc pad; + +memset (&pad,0 ,sizeof (pad));media_device_kpad_to_upad (&entity->pads[p], &pad);if (copy_to_user (&links->pads[p], &pad,sizeof (pad)))return -EFAULT ;@@ -156,6 +158,7 @@ static long __media_device_enum_links(struct
media_device*mdev,>drivers/media/media-device.c +1
-0if (entity->links[l].source->entity != entity)continue ; +memset (&link,0 ,sizeof (link));media_device_kpad_to_upad (entity->links[l].source, &link.source); media_device_kpad_to_upad(entity->links[l].sink,
Signature · 3 lines
Regards, Laurent Pinchart