android_kernel_samsung_a7y1.../drivers/media/platform/omap
Dan Carpenter 6c979f882c media: omap_vout: potential buffer overflow in vidioc_dqbuf()
[ Upstream commit dd6e2a981bfe83aa4a493143fd8cf1edcda6c091 ]

The "b->index" is a u32 the comes from the user in the ioctl.  It hasn't
been checked.  We aren't supposed to use it but we're instead supposed
to use the value that gets written to it when we call videobuf_dqbuf().

The videobuf_dqbuf() first memsets it to zero and then re-initializes it
inside the videobuf_status() function.  It's this final value which we
want.

Hans Verkuil pointed out that we need to check the return from
videobuf_dqbuf().  I ended up doing a little cleanup related to that as
well.

Fixes: 72915e851da9 ("[media] V4L2: OMAP: VOUT: dma map and unmap v4l2 buffers in qbuf and dqbuf")

Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2020-04-07 13:41:46 +02:00
..
Kconfig A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
Makefile A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omap_vout_vrfb.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omap_vout_vrfb.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omap_vout.c media: omap_vout: potential buffer overflow in vidioc_dqbuf() 2020-04-07 13:41:46 +02:00
omap_voutdef.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omap_voutlib.c A750FXXU4CTBC 2020-03-27 21:51:54 +05:30
omap_voutlib.h A750FXXU4CTBC 2020-03-27 21:51:54 +05:30