Skip to content

Commit f1eccc4

Browse files
Christoph Hellwiggregkh
authored andcommitted
scsi: bsg: Remove support for SCSI_IOCTL_SEND_COMMAND
[ Upstream commit beec64d ] 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. Link: https://lore.kernel.org/r/20210724072033.1284840-2-hch@lst.de Fixes: aa387cc ("block: add bsg helper library") Reviewed-by: Bart Van Assche <bvanassche@acm.org> Acked-by: Jens Axboe <axboe@kernel.dk> Signed-off-by: Christoph Hellwig <hch@lst.de> Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent ef5395f commit f1eccc4

1 file changed

Lines changed: 4 additions & 1 deletion

File tree

‎block/bsg.c‎

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -371,10 +371,13 @@ static long bsg_ioctl(struct file *file, unsigned int cmd, unsigned long arg)
371371
case SG_GET_RESERVED_SIZE:
372372
case SG_SET_RESERVED_SIZE:
373373
case SG_EMULATED_HOST:
374-
case SCSI_IOCTL_SEND_COMMAND:
375374
return scsi_cmd_ioctl(bd->queue, NULL, file->f_mode, cmd, uarg);
376375
case SG_IO:
377376
return bsg_sg_io(bd->queue, file->f_mode, uarg);
377+
case SCSI_IOCTL_SEND_COMMAND:
378+
pr_warn_ratelimited("%s: calling unsupported SCSI_IOCTL_SEND_COMMAND\n",
379+
current->comm);
380+
return -EINVAL;
378381
default:
379382
return -ENOTTY;
380383
}

0 commit comments

Comments
 (0)