Re: [PATCH 01/24] bsg: remove support for SCSI_IOCTL_SEND_COMMAND

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

 



On 7/11/21 10:47 PM, Christoph Hellwig wrote:
SCSI_IOCTL_SEND_COMMAND has been deprecated longer than bsg exists
and has been warning for just as long.  More importantly it harcodes
SCSI CDBs and thus will do the wrong thing on non-scsi bsg nodes.

Fixes: aa387cc89567 ("block: add bsg helper library")
Signed-off-by: Christoph Hellwig <hch@xxxxxx>
---
  block/bsg.c | 5 ++++-
  1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/block/bsg.c b/block/bsg.c
index 1f196563ae6c..79b42c5cafeb 100644
--- a/block/bsg.c
+++ b/block/bsg.c
@@ -373,10 +373,13 @@ static long bsg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
  	case SG_GET_RESERVED_SIZE:
  	case SG_SET_RESERVED_SIZE:
  	case SG_EMULATED_HOST:
-	case SCSI_IOCTL_SEND_COMMAND:
  		return scsi_cmd_ioctl(bd->queue, NULL, file->f_mode, cmd, uarg);
  	case SG_IO:
  		return bsg_sg_io(bd->queue, file->f_mode, uarg);
+	case SCSI_IOCTL_SEND_COMMAND:
+		pr_warn_ratelimited("%s: calling unsupported SCSI_IOCTL_SEND_COMMAND\n",
+				current->comm);
+		return -EINVAL;
  	default:
  		return -ENOTTY;
  	}

The Fixes: tag will cause this patch to be backported to stable trees. Is that intentional?

Anyway:

Reviewed-by: Bart Van Assche <bvanassche@xxxxxxx>



[Index of Archives]     [Linux RAID]     [Linux SCSI]     [Linux ATA RAID]     [IDE]     [Linux Wireless]     [Linux Kernel]     [ATH6KL]     [Linux Bluetooth]     [Linux Netdev]     [Kernel Newbies]     [Security]     [Git]     [Netfilter]     [Bugtraq]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Device Mapper]

  Powered by Linux