summaryrefslogtreecommitdiff
path: root/drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
diff options
context:
space:
mode:
authorOliver Neukum <oneukum@suse.com>2018-01-08 09:21:07 -0500
committerMauro Carvalho Chehab <mchehab@s-opensource.com>2018-02-26 06:59:54 -0500
commit50e7044535537b2a54c7ab798cd34c7f6d900bd2 (patch)
treeaa8018ab5ef0caedd67f8ce0db06ab371ec865f1 /drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c
parent81b9de43599c59a3d5bd3e6e8645cb20b87840bc (diff)
downloadlinux-50e7044535537b2a54c7ab798cd34c7f6d900bd2.tar.gz
linux-50e7044535537b2a54c7ab798cd34c7f6d900bd2.tar.bz2
linux-50e7044535537b2a54c7ab798cd34c7f6d900bd2.zip
media: usbtv: prevent double free in error case
Quoting the original report: It looks like there is a double-free vulnerability in Linux usbtv driver on an error path of usbtv_probe function. When audio registration fails, usbtv_video_free function ends up freeing usbtv data structure, which gets freed the second time under usbtv_video_fail label. usbtv_audio_fail: usbtv_video_free(usbtv); => v4l2_device_put(&usbtv->v4l2_dev); => v4l2_device_put => kref_put => v4l2_device_release => usbtv_release (CALLBACK) => kfree(usbtv) (1st time) usbtv_video_fail: usb_set_intfdata(intf, NULL); usb_put_dev(usbtv->udev); kfree(usbtv); (2nd time) So, as we have refcounting, use it Reported-by: Yavuz, Tuba <tuba@ece.ufl.edu> Signed-off-by: Oliver Neukum <oneukum@suse.com> CC: stable@vger.kernel.org Signed-off-by: Hans Verkuil <hans.verkuil@cisco.com> Signed-off-by: Mauro Carvalho Chehab <mchehab@s-opensource.com>
Diffstat (limited to 'drivers/media/platform/mtk-vcodec/mtk_vcodec_dec.c')
0 files changed, 0 insertions, 0 deletions