mirror of
https://github.com/followmsi/android_kernel_google_msm.git
synced 2024-11-06 23:17:41 +00:00
[media] 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. Change-Id: Ie3c281fd75181b10650a4f7f7d791b8dd4aa1eb3 Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@redhat.com>
This commit is contained in:
parent
5ad7557087
commit
c40c161d91
1 changed files with 3 additions and 0 deletions
|
@ -141,6 +141,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;
|
||||
|
@ -158,6 +160,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,
|
||||
|
|
Loading…
Reference in a new issue