diff options
author | Hans Verkuil <hverkuil-cisco@xs4all.nl> | 2022-03-21 11:33:56 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2022-10-05 11:39:40 +0300 |
commit | a6a3b6b11ac0f6edeab66c6b4fb7650108e17a94 (patch) | |
tree | 4aceddb6117e977199bce2604f16ee782ca148b5 | |
parent | ab9d32844742f7803fdf739301480090e9dc9565 (diff) | |
download | linux-a6a3b6b11ac0f6edeab66c6b4fb7650108e17a94.tar.xz |
media: v4l2-compat-ioctl32.c: zero buffer passed to v4l2_compat_get_array_args()
commit 4e768c8e34e639cff66a0f175bc4aebf472e4305 upstream.
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 <hverkuil-cisco@xs4all.nl>
Reported-by: syzbot+ff18193ff05f3f87f226@syzkaller.appspotmail.com
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/media/v4l2-core/v4l2-compat-ioctl32.c | 2 |
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c index 80aaf07b16f2..94037af1af2d 100644 --- a/drivers/media/v4l2-core/v4l2-compat-ioctl32.c +++ b/drivers/media/v4l2-core/v4l2-compat-ioctl32.c @@ -1033,6 +1033,8 @@ int v4l2_compat_get_array_args(struct file *file, void *mbuf, { int err = 0; + memset(mbuf, 0, array_size); + switch (cmd) { case VIDIOC_G_FMT32: case VIDIOC_S_FMT32: |