[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240302105611.1139-1-hdanton@sina.com>
Date: Sat, 2 Mar 2024 18:56:11 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+b2391895514ed9ef4a8e@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: KASAN: use-after-free Read in v4l2_fh_open
On Mon, 15 Feb 2021 07:18:22 -0800
> syzbot found the following issue on:
>
> HEAD commit: 291009f6 Merge tag 'pm-5.11-rc8' of git://git.kernel.org/p..
> git tree: upstream
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=17179dd4d00000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git master
--- x/drivers/media/usb/em28xx/em28xx-video.c
+++ y/drivers/media/usb/em28xx/em28xx-video.c
@@ -2152,6 +2152,10 @@ static int em28xx_v4l2_open(struct file
if (mutex_lock_interruptible(&dev->lock))
return -ERESTARTSYS;
+ if (!dev->v4l2) {
+ mutex_unlock(&dev->lock);
+ return -ENODEV;
+ }
ret = v4l2_fh_open(filp);
if (ret) {
dev_err(&dev->intf->dev,
@@ -2161,6 +2165,7 @@ static int em28xx_v4l2_open(struct file
return ret;
}
+ v4l2 = dev->v4l2;
if (v4l2->users == 0) {
em28xx_set_mode(dev, EM28XX_ANALOG_MODE);
--
Powered by blists - more mailing lists