FAILED: patch "[PATCH] scsi: scsi_ioctl: Validate command size" failed to apply to 5.14-stable tree
Subsystems (2)
[email protected]
maintainerThe patch below does not apply to the 5.14-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 20aaef52eb08f1d987d46ad26edb8f142f74d83a Mon Sep 17 00:00:00 2001
From: Tadeusz Struk <[email protected]>
Date: Wed, 3 Nov 2021 10:06:58 -0700
Subject: [PATCH] scsi: scsi_ioctl: Validate command size
Need to make sure the command size is valid before copying the command from user space.
Cc Bart Van Assche <[email protected]>
Cc Christoph Hellwig <[email protected]>
Cc James E.J. Bottomley <[email protected]>
Cc Martin K. Petersen <[email protected]>
Cc <[email protected]>
Cc <[email protected]>
Cc <[email protected]> # 5.15, 5.14, 5.10
Signed-off-by Tadeusz Struk <[email protected]>
Signed-off-by Martin K. Petersen <[email protected]>
drivers/scsi/scsi_ioctl.c +2 -0
@@ -347,6 +347,8 @@ static int scsi_fill_sghdr_rq(struct scsi_device *sdev, struct request *rq, {struct scsi_request *req =scsi_req (rq); +if (hdr->cmd_len <6 ) +return -EMSGSIZE ;if (copy_from_user (req->cmd, hdr->cmdp, hdr->cmd_len))return -EFAULT ;if (!scsi_cmd_allowed (req->cmd, mode))