From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+a11c46f37ee083a73deb@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [media?] KASAN: use-after-free Read in em28xx_close_extension (2)
Date: Fri, 20 Sep 2024 19:28:09 +0800 [thread overview]
Message-ID: <20240920112809.627-1-hdanton@sina.com> (raw)
In-Reply-To: <66ec3c83.050a0220.29194.002f.GAE@google.com>
On Thu, 19 Sep 2024 08:00:19 -0700
> syzbot found the following issue on:
>
> HEAD commit: 68d4209158f4 sub: cdns3: Use predefined PCI vendor ID cons..
> git tree: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git usb-testing
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=11166200580000
#syz test
--- x/drivers/media/usb/em28xx/em28xx-core.c
+++ y/drivers/media/usb/em28xx/em28xx-core.c
@@ -1134,7 +1134,7 @@ void em28xx_close_extension(struct em28x
ops->fini(dev);
}
}
- list_del(&dev->devlist);
+ list_del_init(&dev->devlist);
mutex_unlock(&em28xx_devlist_mutex);
}
--- x/drivers/media/usb/em28xx/em28xx-cards.c
+++ y/drivers/media/usb/em28xx/em28xx-cards.c
@@ -3910,6 +3910,7 @@ static int em28xx_usb_probe(struct usb_i
retval = -ENOMEM;
goto err;
}
+ INIT_LIST_HEAD(&dev->devlist);
/* compute alternate max packet sizes */
dev->alt_max_pkt_size_isoc = kcalloc(intf->num_altsetting,
@@ -4156,6 +4157,8 @@ static int em28xx_usb_probe(struct usb_i
return 0;
err_free:
+ if (!list_empty(&dev->devlist))
+ em28xx_close_extension(dev);
kfree(dev->alt_max_pkt_size_isoc);
kfree(dev);
--
next prev parent reply other threads:[~2024-09-20 11:28 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-09-19 15:00 [syzbot] [media?] KASAN: use-after-free Read in em28xx_close_extension (2) syzbot
2024-09-20 11:28 ` Hillf Danton [this message]
2024-09-20 12:00 ` syzbot
2024-09-20 23:00 ` Hillf Danton
2024-09-20 23:19 ` syzbot
2025-11-10 9:59 ` Fedor Pchelkin
2025-11-10 10:19 ` [syzbot] [usb?] " syzbot
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240920112809.627-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+a11c46f37ee083a73deb@syzkaller.appspotmail.com \
--cc=syzkaller-bugs@googlegroups.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox