[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20240515103325.3308-1-hdanton@sina.com>
Date: Wed, 15 May 2024 18:33:25 +0800
From: Hillf Danton <hdanton@...a.com>
To: syzbot <syzbot+2f44671e54488d20f0e6@...kaller.appspotmail.com>
Cc: linux-kernel@...r.kernel.org,
syzkaller-bugs@...glegroups.com
Subject: Re: [syzbot] [kernfs?] [usb?] WARNING in kernfs_get (5)
On Tue, 14 May 2024 08:44:43 -0700
> syzbot has found a reproducer for the following issue on:
>
> HEAD commit: 26dd54d03cd9 Add linux-next specific files for 20240514
> git tree: linux-next
> syz repro: https://syzkaller.appspot.com/x/repro.syz?x=14b06900980000
#syz test https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git 26dd54d03cd9
--- l/drivers/base/firmware_loader/fallback.c
+++ f/drivers/base/firmware_loader/fallback.c
@@ -83,15 +83,15 @@ static int fw_load_sysfs_fallback(struct
dev_set_uevent_suppress(f_dev, true);
+ mutex_lock(&fw_lock);
+
retval = device_add(f_dev);
if (retval) {
dev_err(f_dev, "%s: device_register failed\n", __func__);
goto err_put_dev;
}
- mutex_lock(&fw_lock);
if (fw_load_abort_all || fw_state_is_aborted(fw_priv)) {
- mutex_unlock(&fw_lock);
retval = -EINTR;
goto out;
}
@@ -120,10 +120,12 @@ static int fw_load_sysfs_fallback(struct
} else if (fw_priv->is_paged_buf && !fw_priv->data)
retval = -ENOMEM;
+ mutex_lock(&fw_lock);
out:
device_del(f_dev);
err_put_dev:
put_device(f_dev);
+ mutex_unlock(&fw_lock);
return retval;
}
--- l/drivers/base/firmware_loader/sysfs.c
+++ s/drivers/base/firmware_loader/sysfs.c
@@ -81,10 +81,8 @@ static int firmware_uevent(const struct
const struct fw_sysfs *fw_sysfs = to_fw_sysfs(dev);
int err = 0;
- mutex_lock(&fw_lock);
if (fw_sysfs->fw_priv)
err = do_firmware_uevent(fw_sysfs, env);
- mutex_unlock(&fw_lock);
return err;
}
#endif /* CONFIG_FW_LOADER_USER_HELPER */
--
Powered by blists - more mailing lists