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: <41daf1a9-590a-e220-84a3-648eb895272b@zhaoxin.com>
Date: Fri, 23 Feb 2024 04:06:23 +0800
From: "WeitaoWang-oc@...oxin.com" <WeitaoWang-oc@...oxin.com>
To: Oliver Neukum <oneukum@...e.com>, <stern@...land.harvard.edu>,
	<gregkh@...uxfoundation.org>, <linux-usb@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <linux-scsi@...r.kernel.org>,
	<usb-storage@...ts.one-eyed-alien.net>
CC: <WeitaoWang@...oxin.com>
Subject: Re: [PATCH] USB:UAS:return ENODEV when submit urbs fail with device
 not attached.

On 2024/2/22 17:47, Oliver Neukum wrote:
> 

> On 22.02.24 17:54, Weitao Wang wrote:
>> In the scenario of entering hibernation with udisk in the system, if the
>> udisk was gone or resume fail in the thaw phase of hibernation. Its state
>> will be set to NOTATTACHED. However, usb_hub_wq was already freezed and
>> can't not handle disconnect event. Then, sync cache SCSI command will be
>> sent to this udisk on the poweroff phase of hibernation, that will cause
> 
> Wait, this seems like a contradiction. Are we in thaw or are we powering off?

This fail appear in poweroff phase of hibernation.

>> uas_submit_urbs to be called to submit URB to sense/data/cmd pipe. Then,
>> usb_submit_urb return value -ENODEV when device was set to NOTATTACHED
>> state. However, uas_submit_urbs always return "SCSI_MLQUEUE_DEVICE_BUSY"
>> regardless of the reason for submission failure.That will lead the SCSI
>> layer go into an ugly loop and system fail to go into hibernation.
> 
> The thing is that the SCSI documentation explicitly tells us to return
> either SCSI_MLQUEUE_DEVICE_BUSY or SCSI_MLQUEUE_HOST_BUSY. Now, it makes
> sense to tell the SCSI laer that a device or host is gone for good,
> if we know that. But we cannot just introduce new error returns on our own.
> 
> This needs to be addressed. That means that the SCSI layer or at the
> very least the documentation needs to be fixed. Frankly, this is not strictly
> speaking a UAS issue. Any thing hotunpluggable should have this issue.
> 

Maybe, my description was not accurate enough, here not add new return
value to scsi layer,it just add a case to tell device is gone in the uas
driver internal and the ENODEV error code not return to scsi layer.
Here just notify SCSI layer of device loss through flag DID_NO_CONNECT.
This is also hope to fix this issue in the uas driver internal.

Thanks and best regards,
weitao


Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ