Linux ATA/IDE development
 help / color / mirror / Atom feed
* [PATCH] ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT
@ 2026-11-16 19:10 Niklas Cassel
  0 siblings, 0 replies; only message in thread
From: Niklas Cassel @ 2026-11-16 19:10 UTC (permalink / raw)
  To: Damien Le Moal; +Cc: linux-ide, Niklas Cassel, stable

ata_scsi_security_inout_xlat() tests the INC_512 bit with cdb[4] & 7.
INC_512 is bit 7 of byte 4 of the SECURITY PROTOCOL IN and SECURITY
PROTOCOL OUT CDBs (SPC-6, tables 280 and 282), and bits 6:0 of that
byte are reserved.

Test bit 7 instead.

Fixes: 818831c8b22f ("libata: implement SECURITY PROTOCOL IN/OUT")
Cc: stable@vger.kernel.org
Signed-off-by: Niklas Cassel <cassel@kernel.org>
---
 drivers/ata/libata-scsi.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/ata/libata-scsi.c b/drivers/ata/libata-scsi.c
index 87a57495d2e4..ae062fd23684 100644
--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4812,7 +4812,7 @@ static unsigned int ata_scsi_security_inout_xlat(struct ata_queued_cmd *qc)
 		return 1;
 	}
 
-	if (cdb[4] & 7) { /* INC_512 */
+	if (cdb[4] & 0x80) { /* INC_512 */
 		if (len > 0xffff) {
 			ata_scsi_set_invalid_field(qc->dev, scmd, 6, 0);
 			return 1;
-- 
2.56.1


^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-11-16 19:10 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-11-16 19:10 [PATCH] ata: libata-scsi: fix the INC_512 bit test for SECURITY PROTOCOL IN/OUT Niklas Cassel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox