Patch "ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES" has been added to the 6.1-stable tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



This is a note to let you know that I've just added the patch titled

    ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES

to the 6.1-stable tree which can be found at:
    http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary

The filename of the patch is:
     ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch
and it can be found in the queue-6.1 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree,
please let <stable@xxxxxxxxxxxxxxx> know about it.


>From 3ef600923521616ebe192c893468ad0424de2afb Mon Sep 17 00:00:00 2001
From: Niklas Cassel <niklas.cassel@xxxxxxx>
Date: Mon, 18 Sep 2023 22:24:50 +0200
Subject: ata: libata-scsi: ignore reserved bits for REPORT SUPPORTED OPERATION CODES

From: Niklas Cassel <niklas.cassel@xxxxxxx>

commit 3ef600923521616ebe192c893468ad0424de2afb upstream.

For REPORT SUPPORTED OPERATION CODES command, the service action field is
defined as bits 0-4 in the second byte in the CDB. Bits 5-7 in the second
byte are reserved.

Only look at the service action field in the second byte when determining
if the MAINTENANCE IN opcode is a REPORT SUPPORTED OPERATION CODES command.

This matches how we only look at the service action field in the second
byte when determining if the SERVICE ACTION IN(16) opcode is a READ
CAPACITY(16) command (reserved bits 5-7 in the second byte are ignored).

Fixes: 7b2030942859 ("libata: Add support for SCT Write Same")
Cc: stable@xxxxxxxxxxxxxxx
Signed-off-by: Niklas Cassel <niklas.cassel@xxxxxxx>
Signed-off-by: Damien Le Moal <dlemoal@xxxxxxxxxx>
Signed-off-by: Greg Kroah-Hartman <gregkh@xxxxxxxxxxxxxxxxxxx>
---
 drivers/ata/libata-scsi.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

--- a/drivers/ata/libata-scsi.c
+++ b/drivers/ata/libata-scsi.c
@@ -4227,7 +4227,7 @@ void ata_scsi_simulate(struct ata_device
 		break;
 
 	case MAINTENANCE_IN:
-		if (scsicmd[1] == MI_REPORT_SUPPORTED_OPERATION_CODES)
+		if ((scsicmd[1] & 0x1f) == MI_REPORT_SUPPORTED_OPERATION_CODES)
 			ata_scsi_rbuf_fill(&args, ata_scsiop_maint_in);
 		else
 			ata_scsi_set_invalid_field(dev, cmd, 1, 0xff);


Patches currently in stable-queue which might be from niklas.cassel@xxxxxxx are

queue-6.1/ata-libata-scsi-ignore-reserved-bits-for-report-supported-operation-codes.patch
queue-6.1/ata-libata-scsi-link-ata-port-and-scsi-device.patch
queue-6.1/ata-libata-eh-do-not-clear-ata_pflag_eh_pending-in-a.patch



[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]

  Powered by Linux