]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
scsi: bsg: Remove support for SCSI_IOCTL_SEND_COMMAND
authorChristoph Hellwig <hch@lst.de>
Sat, 24 Jul 2021 07:20:10 +0000 (09:20 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 18 Sep 2021 11:41:50 +0000 (13:41 +0200)
[ Upstream commit beec64d0c9749afedf51c3c10cf52de1d9a89cc0 ]

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: aa387cc89567 ("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>
block/bsg.c

index bd10922d5cbb428b29068e898927e500bd615cf0..4d0ad5846ccfa546640fed07a85e3d4d95792664 100644 (file)
@@ -371,10 +371,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;
        }