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-prev] [thread-next>] [day] [month] [year] [list]
Message-Id: <20210929224823.556943-2-rajatja@google.com>
Date:   Wed, 29 Sep 2021 15:48:23 -0700
From:   Rajat Jain <rajatja@...gle.com>
To:     Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
        Alan Stern <stern@...land.harvard.edu>,
        Rajat Jain <rajatja@...gle.com>,
        Thinh Nguyen <Thinh.Nguyen@...opsys.com>,
        Mathias Nyman <mathias.nyman@...ux.intel.com>,
        Andrew Lunn <andrew@...n.ch>,
        Chris Chiu <chris.chiu@...onical.com>,
        linux-usb@...r.kernel.org, linux-kernel@...r.kernel.org
Cc:     levinale@...gle.com, bleung@...gle.com, rajatxjain@...il.com,
        jsbarnes@...gle.com, pmalani@...gle.com
Subject: [PATCH 2/2] usb: hub: Mark devices downstream a removable hub, as removable

If a usb device sits below a removable hub, mark the device also as
removable. This helps with devices inserted on a standard removable hub or
also thunderbold docks, to be shown as removable.

Signed-off-by: Rajat Jain <rajatja@...gle.com>
---
 drivers/usb/core/hub.c | 7 +++++++
 1 file changed, 7 insertions(+)

diff --git a/drivers/usb/core/hub.c b/drivers/usb/core/hub.c
index 45d1c81b121d..901d74bcdbd9 100644
--- a/drivers/usb/core/hub.c
+++ b/drivers/usb/core/hub.c
@@ -2449,6 +2449,13 @@ static void set_usb_port_removable(struct usb_device *udev)
 		if (udev->dev.parent && dev_is_removable(udev->dev.parent))
 			dev_set_removable(&udev->dev, DEVICE_REMOVABLE);
 		return;
+	} else if (dev_is_removable(&hdev->dev)) {
+		/*
+		 * If this USB device sits downstream a removable hub, then mark
+		 * this device also as removable.
+		 */
+		dev_set_removable(&udev->dev, DEVICE_REMOVABLE);
+		return;
 	}
 
 	hub = usb_hub_to_struct_hub(udev->parent);
-- 
2.33.0.685.g46640cef36-goog

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ