Re: [syzbot] [bluetooth?] KASAN: slab-use-after-free Read in skb_queue_purge_reason (2)

From: Hillf Danton
Date: Wed Feb 05 2025 - 06:11:08 EST


On Tue, 04 Feb 2025 06:48:26 -0800
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 40b8e93e17bf Add linux-next specific files for 20250204
> git tree: linux-next
> C reproducer: https://syzkaller.appspot.com/x/repro.c?x=12f74f64580000

#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git master

--- x/drivers/bluetooth/hci_mrvl.c
+++ y/drivers/bluetooth/hci_mrvl.c
@@ -97,11 +97,14 @@ static int mrvl_close(struct hci_uart *h
if (hu->serdev)
serdev_device_close(hu->serdev);

+ if (!mrvl)
+ goto out;
skb_queue_purge(&mrvl->txq);
skb_queue_purge(&mrvl->rawq);
kfree_skb(mrvl->rx_skb);
kfree(mrvl);

+out:
hu->priv = NULL;
return 0;
}
--