Skip to content

Commit 4e768c8

Browse files
Hans Verkuilmchehab
authored andcommitted
media: v4l2-compat-ioctl32.c: zero buffer passed to v4l2_compat_get_array_args()
The v4l2_compat_get_array_args() function can leave uninitialized memory in the buffer it is passed. So zero it before copying array elements from userspace into the buffer. Signed-off-by: Hans Verkuil <[email protected]> Reported-by: [email protected] Reviewed-by: Laurent Pinchart <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 150f7b1 commit 4e768c8

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

drivers/media/v4l2-core/v4l2-compat-ioctl32.c

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1040,6 +1040,8 @@ int v4l2_compat_get_array_args(struct file *file, void *mbuf,
10401040
{
10411041
int err = 0;
10421042

1043+
memset(mbuf, 0, array_size);
1044+
10431045
switch (cmd) {
10441046
case VIDIOC_G_FMT32:
10451047
case VIDIOC_S_FMT32:

0 commit comments

Comments
 (0)