From: Hillf Danton <hdanton@sina.com>
To: syzbot <syzbot+a658d41cf8564471775e@syzkaller.appspotmail.com>
Cc: linux-kernel@vger.kernel.org, syzkaller-bugs@googlegroups.com
Subject: Re: [syzbot] [media?] [usb?] KASAN: slab-use-after-free Read in v4l2_release (2)
Date: Sun, 24 Aug 2025 16:09:16 +0800 [thread overview]
Message-ID: <20250824080918.5312-1-hdanton@sina.com> (raw)
In-Reply-To: <68aaae76.050a0220.37038e.006e.GAE@google.com>
> Date: Sat, 23 Aug 2025 23:17:26 -0700 [thread overview]
> Hello,
>
> syzbot found the following issue on:
>
> HEAD commit: 8d245acc1e88 Merge tag 'char-misc-6.17-rc3' of git://git.k..
> git tree: upstream
> console output: https://syzkaller.appspot.com/x/log.txt?x=15f37062580000
> kernel config: https://syzkaller.appspot.com/x/.config?x=292f3bc9f654adeb
> dashboard link: https://syzkaller.appspot.com/bug?extid=a658d41cf8564471775e
> compiler: Debian clang version 20.1.7 (++20250616065708+6146a88f6049-1~exp1~20250616065826.132), Debian LLD 20.1.7
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14c267bc580000
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=13a8c862580000
#syz test
--- x/drivers/media/usb/hackrf/hackrf.c
+++ y/drivers/media/usb/hackrf/hackrf.c
@@ -1345,7 +1345,7 @@ static int hackrf_probe(struct usb_inter
const struct usb_device_id *id)
{
struct hackrf_dev *dev;
- int ret;
+ int ret, registered = 0;
u8 u8tmp, buf[BUF_SIZE];
dev = kzalloc(sizeof(*dev), GFP_KERNEL);
@@ -1487,6 +1487,7 @@ static int hackrf_probe(struct usb_inter
"Failed to register as video device (%d)\n", ret);
goto err_v4l2_device_unregister;
}
+ registered++;
dev_info(dev->dev, "Registered as %s\n",
video_device_node_name(&dev->rx_vdev));
@@ -1520,7 +1521,8 @@ err_v4l2_ctrl_handler_free_tx:
err_v4l2_ctrl_handler_free_rx:
v4l2_ctrl_handler_free(&dev->rx_ctrl_handler);
err_kfree:
- kfree(dev);
+ if (!registered)
+ kfree(dev);
err:
dev_dbg(&intf->dev, "failed=%d\n", ret);
return ret;
--
next prev parent reply other threads:[~2025-08-24 8:09 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-08-24 6:17 syzbot
2025-08-24 8:09 ` Hillf Danton [this message]
2025-08-24 8:37 ` 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=20250824080918.5312-1-hdanton@sina.com \
--to=hdanton@sina.com \
--cc=linux-kernel@vger.kernel.org \
--cc=syzbot+a658d41cf8564471775e@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
all inboxes | Powered by JetHome®