TencentOS-kernel/drivers/media
Sakari Ailus 7a3c10f3d4 media: v4l: ioctl: Fix memory leak in video_usercopy
commit fb18802a338b36f675a388fc03d2aa504a0d0899 upstream.

When an IOCTL with argument size larger than 128 that also used array
arguments were handled, two memory allocations were made but alas, only
the latter one of them was released. This happened because there was only
a single local variable to hold such a temporary allocation.

Fix this by adding separate variables to hold the pointers to the
temporary allocations.

Reported-by: Arnd Bergmann <arnd@kernel.org>
Reported-by: syzbot+1115e79c8df6472c612b@syzkaller.appspotmail.com
Fixes: d14e6d76ebf7 ("[media] v4l: Add multi-planar ioctl handling code")
Cc: stable@vger.kernel.org
Signed-off-by: Sakari Ailus <sakari.ailus@linux.intel.com>
Acked-by: Arnd Bergmann <arnd@arndb.de>
Acked-by: Hans Verkuil <hverkuil-cisco@xs4all.nl>
Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com>
Signed-off-by: Mauro Carvalho Chehab <mchehab+huawei@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
2021-04-12 12:52:50 +08:00
..
cec cec-api: prevent leaking memory through hole in structure 2021-03-16 16:34:50 +08:00
common media: siano: fix memory leak of debugfs members in smsdvb_hotplug 2021-03-16 16:42:53 +08:00
dvb-core media: dvbdev: Fix tuner->demod media controller link 2021-03-16 16:29:21 +08:00
dvb-frontends media: tda10071: fix unsigned sign extension overflow 2021-03-16 16:37:00 +08:00
firewire media: firewire: fix memory leak 2021-03-16 16:39:12 +08:00
i2c media: i2c: ov5670: Fix PIXEL_RATE minimum value 2021-04-12 12:52:17 +08:00
mc media: mc-device.c: fix memleak in media_device_register_entity 2021-03-16 16:36:31 +08:00
mmc Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
pci media: smipcie: fix interrupt handling and IR timeout 2021-04-12 12:52:39 +08:00
platform media: pxa_camera: declare variable when DEBUG is defined 2021-04-12 12:52:19 +08:00
radio Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
rc media: mceusb: sanity check for prescaler value 2021-04-12 12:52:44 +08:00
spi Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
tuners media: qm1d1c0042: fix error return code in qm1d1c0042_init() 2021-04-12 12:52:19 +08:00
usb media: uvcvideo: Allow entities with no pads 2021-04-12 12:52:47 +08:00
v4l2-core media: v4l: ioctl: Fix memory leak in video_usercopy 2021-04-12 12:52:50 +08:00
Kconfig Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00
Makefile Init Repo base on linux 5.4.32 long term, and add base tlinux kernel interfaces. 2021-03-16 11:01:34 +08:00