[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <tencent_55464A0A741D765767043CCB37A896943709@qq.com>
Date: Tue, 30 Jul 2024 14:29:06 +0800
From: Edward Adam Davis <eadavis@...com>
To: syzbot+916742d5d24f6c254761@...kaller.appspotmail.com
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [usb?] KASAN: slab-use-after-free Read in hdm_disconnect
move the relase dev to the end
#syz test: https://git.kernel.org/pub/scm/linux/kernel/git/gregkh/usb.git 933069701c1b
diff --git a/drivers/base/dd.c b/drivers/base/dd.c
index 83d352394fdf..02f5aeadd8fd 100644
--- a/drivers/base/dd.c
+++ b/drivers/base/dd.c
@@ -1027,6 +1027,8 @@ static int __device_attach(struct device *dev, bool allow_async)
ret = bus_for_each_drv(dev->bus, NULL, &data,
__device_attach_driver);
+ if (!ret)
+ get_device(dev);
if (!ret && allow_async && data.have_async) {
/*
* If we could not find appropriate driver
@@ -1036,7 +1038,6 @@ static int __device_attach(struct device *dev, bool allow_async)
* try them.
*/
dev_dbg(dev, "scheduling asynchronous probe\n");
- get_device(dev);
async = true;
} else {
pm_request_idle(dev);
Powered by blists - more mailing lists