From: Kamil Kaminski <kylek389@gmail.com>
To: linux-scsi@vger.kernel.org
Cc: James.Bottomley@HansenPartnership.com,
martin.petersen@oracle.com, linux-kernel@vger.kernel.org,
kylek389@gmail.com
Subject: Subject: [PATCH 1/2] scsi: core: Treat "Logical unit access not authorized" as permanent error
Date: Wed, 25 Feb 2026 17:13:57 -0600 [thread overview]
Message-ID: <786c3713-ebd7-406a-bb93-ce43e249583d@gmail.com> (raw)
From 21dfa18035fb03b9c141550aeded92cf6d23473a Mon Sep 17 00:00:00 2001
From: Kamil Kaminski <kylek389@gmail.com>
Date: Wed, 25 Feb 2026 13:42:12 -0600
Subject: [PATCH 1/2] scsi: core: Treat "Logical unit access not
authorized" as
permanent error
SanDisk Extreme Portable SSD and similar hardware-encrypted USB drives
return Sense Key DATA_PROTECT (0x07) with ASC 0x74, ASCQ 0x71 ("Logical
unit access not authorized") when password-locked.
The SCSI error handler currently treats this as a generic DATA_PROTECT
error. While it eventually fails the command, the block layer continues
retrying operations, causing excessive I/O errors that saturate the USB
bus and crash xHCI controllers (kernel bug 216696).
Add special handling to return SUCCESS immediately for ASC 0x74/ASCQ
0x71, preventing SCSI-level retries and allowing the sd driver to
handle the condition gracefully.
Closes: https://bugzilla.kernel.org/show_bug.cgi?id=216696
Signed-off-by: Kamil Kaminski <kylek389@gmail.com>
---
drivers/scsi/scsi_error.c | 18 ++++++++++++++++++
1 file changed, 18 insertions(+)
diff --git a/drivers/scsi/scsi_error.c b/drivers/scsi/scsi_error.c
index 147127fb4db9..aceb7c55893b 100644
--- a/drivers/scsi/scsi_error.c
+++ b/drivers/scsi/scsi_error.c
@@ -692,6 +691,23 @@ enum scsi_disposition scsi_check_sense(struct
scsi_cmnd *scmd)
/* these are not supported */
case DATA_PROTECT:
+ /*
+ * ASC 0x74/ASCQ 0x71: "Logical unit access not authorized"
+ *
+ * This indicates a password-locked or hardware-encrypted device
+ * (e.g., SanDisk Extreme Portable SSD, WD My Passport) that
+ * requires vendor-specific unlock software.
+ *
+ * Unlike write protection, this is a security lock that cannot
+ * be cleared by the OS. Retrying causes USB bus saturation.
+ * Treat as permanent failure immediately.
+ */
+ if (sshdr.asc == 0x74 && sshdr.ascq == 0x71) {
+ sdev_printk(KERN_WARNING, scmd->device,
+ "scsi: Logical unit access not authorized - device
is password locked, treating as permanent error\n");
+ set_scsi_ml_byte(scmd, SCSIML_STAT_TGT_FAILURE);
+ return SUCCESS;
+ }
if (sshdr.asc == 0x27 && sshdr.ascq == 0x07) {
/* Thin provisioning hard threshold reached */
set_scsi_ml_byte(scmd, SCSIML_STAT_NOSPC);
--
2.53.0
reply other threads:[~2026-02-25 23:14 UTC|newest]
Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=786c3713-ebd7-406a-bb93-ce43e249583d@gmail.com \
--to=kylek389@gmail.com \
--cc=James.Bottomley@HansenPartnership.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-scsi@vger.kernel.org \
--cc=martin.petersen@oracle.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox