From b89783196b336fcde8a1565e4af0cae6584ea202 Mon Sep 17 00:00:00 2001 From: Greg Kroah-Hartman Date: Mon, 6 Sep 2021 10:57:52 +0200 Subject: [PATCH] 4.4-stable patches added patches: media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch --- ...-fix-memory-leak-in-stk_camera_probe.patch | 49 +++++++++++++++++++ queue-4.4/series | 1 + 2 files changed, 50 insertions(+) create mode 100644 queue-4.4/media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch diff --git a/queue-4.4/media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch b/queue-4.4/media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch new file mode 100644 index 00000000000..a07de279859 --- /dev/null +++ b/queue-4.4/media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch @@ -0,0 +1,49 @@ +From 514e97674400462cc09c459a1ddfb9bf39017223 Mon Sep 17 00:00:00 2001 +From: Pavel Skripkin +Date: Wed, 7 Jul 2021 19:54:30 +0200 +Subject: media: stkwebcam: fix memory leak in stk_camera_probe + +From: Pavel Skripkin + +commit 514e97674400462cc09c459a1ddfb9bf39017223 upstream. + +My local syzbot instance hit memory leak in usb_set_configuration(). +The problem was in unputted usb interface. In case of errors after +usb_get_intf() the reference should be putted to correclty free memory +allocated for this interface. + +Fixes: ec16dae5453e ("V4L/DVB (7019): V4L: add support for Syntek DC1125 webcams") +Cc: stable@vger.kernel.org +Signed-off-by: Pavel Skripkin +Signed-off-by: Hans Verkuil +Signed-off-by: Mauro Carvalho Chehab +Signed-off-by: Greg Kroah-Hartman +--- + drivers/media/usb/stkwebcam/stk-webcam.c | 6 ++++-- + 1 file changed, 4 insertions(+), 2 deletions(-) + +--- a/drivers/media/usb/stkwebcam/stk-webcam.c ++++ b/drivers/media/usb/stkwebcam/stk-webcam.c +@@ -1353,7 +1353,7 @@ static int stk_camera_probe(struct usb_i + if (!dev->isoc_ep) { + STK_ERROR("Could not find isoc-in endpoint"); + err = -ENODEV; +- goto error; ++ goto error_put; + } + dev->vsettings.palette = V4L2_PIX_FMT_RGB565; + dev->vsettings.mode = MODE_VGA; +@@ -1366,10 +1366,12 @@ static int stk_camera_probe(struct usb_i + + err = stk_register_video_device(dev); + if (err) +- goto error; ++ goto error_put; + + return 0; + ++error_put: ++ usb_put_intf(interface); + error: + v4l2_ctrl_handler_free(hdl); + v4l2_device_unregister(&dev->v4l2_dev); diff --git a/queue-4.4/series b/queue-4.4/series index 426248d69d0..79f97360ef9 100644 --- a/queue-4.4/series +++ b/queue-4.4/series @@ -10,3 +10,4 @@ ath9k-clear-key-cache-explicitly-on-disabling-hardware.patch ath-export-ath_hw_keysetmac.patch ath-modify-ath_key_delete-to-not-need-full-key-entry.patch ath9k-postpone-key-cache-entry-deletion-for-txq-frames-reference-it.patch +media-stkwebcam-fix-memory-leak-in-stk_camera_probe.patch -- 2.47.3