2017-11-09 05:51:28

by Arvind Yadav

[permalink] [raw]
Subject: [RFT] [media] em28xx: Fix use-after-free in v4l2_fh_init

Here, em28xx_free_v4l2 is release "v4l2->dev->v4l2"
Which is allready release by em28xx_v4l2_init.

Signed-off-by: Arvind Yadav <[email protected]>
---
This bug report by Andrey Konovalov "net/media/em28xx: use-after-free in v4l2_fh_init"

drivers/media/usb/em28xx/em28xx-video.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/media/usb/em28xx/em28xx-video.c b/drivers/media/usb/em28xx/em28xx-video.c
index 8d253a5..f1ee53f 100644
--- a/drivers/media/usb/em28xx/em28xx-video.c
+++ b/drivers/media/usb/em28xx/em28xx-video.c
@@ -2785,8 +2785,8 @@ static int em28xx_v4l2_init(struct em28xx *dev)
v4l2_ctrl_handler_free(&v4l2->ctrl_handler);
v4l2_device_unregister(&v4l2->v4l2_dev);
err:
- dev->v4l2 = NULL;
kref_put(&v4l2->ref, em28xx_free_v4l2);
+ dev->v4l2 = NULL;
mutex_unlock(&dev->lock);
return ret;
}
--
1.9.1


From 1583715506263128383@xxx Fri Nov 10 21:20:02 +0000 2017
X-GM-THRID: 1583404362006957391
X-Gmail-Labels: Inbox,Category Forums,HistoricalUnread