lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Mon, 2 Aug 2021 23:22:05 +0100
From:   Salah Triki <salah.triki@...il.com>
To:     Keith Packard <keithp@...thp.com>,
        Greg Kroah-Hartman <gregkh@...uxfoundation.org>
Cc:     linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: [PATCH] usb: misc: chaoskey: get lock before calling
 usb_[disable|enable]_autosuspend()

Based on the documentation of usb_[disable|enable]_autosuspend(), the
caller must hold udev's device lock.

Signed-off-by: Salah Triki <salah.triki@...il.com>
---
 drivers/usb/misc/chaoskey.c | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/drivers/usb/misc/chaoskey.c b/drivers/usb/misc/chaoskey.c
index 87067c3d6109..8af00be7b9e8 100644
--- a/drivers/usb/misc/chaoskey.c
+++ b/drivers/usb/misc/chaoskey.c
@@ -206,7 +206,9 @@ static int chaoskey_probe(struct usb_interface *interface,
 	if (!dev->hwrng_registered)
 		usb_err(interface, "Unable to register with hwrng");
 
+	usb_lock_device(udev);
 	usb_enable_autosuspend(udev);
+	usb_unlock_device(udev);
 
 	usb_dbg(interface, "chaoskey probe success, size %d", dev->size);
 	return 0;
-- 
2.25.1

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ