From: Greg Kroah-Hartman Date: Thu, 11 Jun 2020 11:21:37 +0000 (+0200) Subject: 4.9-stable patches X-Git-Tag: v5.4.47~138 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=d04784f5c6256f0cc334da645849338e899083b0;p=thirdparty%2Fkernel%2Fstable-queue.git 4.9-stable patches added patches: crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch --- diff --git a/queue-4.9/crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch b/queue-4.9/crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch new file mode 100644 index 00000000000..2d5ecc3bc72 --- /dev/null +++ b/queue-4.9/crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch @@ -0,0 +1,57 @@ +From cantona@cantona.net Thu Jun 11 12:53:25 2020 +From: Su Kang Yin +Date: Thu, 11 Jun 2020 18:07:45 +0800 +Subject: crypto: talitos - fix ECB and CBC algs ivsize +To: gregkh@linuxfoundation.org, linux-crypto@vger.kernel.org, christophe.leroy@c-s.fr +Cc: Su Kang Yin , Herbert Xu , "David S. Miller" , linux-kernel@vger.kernel.org +Message-ID: <20200611100745.6513-1-cantona@cantona.net> + +From: Su Kang Yin + +Patch for 4.9 upstream: + +commit e1de42fdfc6a ("crypto: talitos - fix ECB algs ivsize") +wrongly modified CBC algs ivsize instead of ECB aggs ivsize. + +This restore the CBC algs original ivsize of removes ECB's ones. + +Signed-off-by: Su Kang Yin +Signed-off-by: Greg Kroah-Hartman +--- + drivers/crypto/talitos.c | 4 +--- + 1 file changed, 1 insertion(+), 3 deletions(-) + +--- a/drivers/crypto/talitos.c ++++ b/drivers/crypto/talitos.c +@@ -2636,7 +2636,6 @@ static struct talitos_alg_template drive + .cra_ablkcipher = { + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, +- .ivsize = AES_BLOCK_SIZE, + } + }, + .desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | +@@ -2670,6 +2669,7 @@ static struct talitos_alg_template drive + .cra_ablkcipher = { + .min_keysize = AES_MIN_KEY_SIZE, + .max_keysize = AES_MAX_KEY_SIZE, ++ .ivsize = AES_BLOCK_SIZE, + .setkey = ablkcipher_aes_setkey, + } + }, +@@ -2687,7 +2687,6 @@ static struct talitos_alg_template drive + .cra_ablkcipher = { + .min_keysize = DES_KEY_SIZE, + .max_keysize = DES_KEY_SIZE, +- .ivsize = DES_BLOCK_SIZE, + } + }, + .desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | +@@ -2720,7 +2719,6 @@ static struct talitos_alg_template drive + .cra_ablkcipher = { + .min_keysize = DES3_EDE_KEY_SIZE, + .max_keysize = DES3_EDE_KEY_SIZE, +- .ivsize = DES3_EDE_BLOCK_SIZE, + } + }, + .desc_hdr_template = DESC_HDR_TYPE_COMMON_NONSNOOP_NO_AFEU | diff --git a/queue-4.9/scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch b/queue-4.9/scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch new file mode 100644 index 00000000000..dd8e132e974 --- /dev/null +++ b/queue-4.9/scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch @@ -0,0 +1,51 @@ +From e7661a8e5ce10b5321882d0bbaf3f81070903319 Mon Sep 17 00:00:00 2001 +From: Johannes Thumshirn +Date: Wed, 12 Apr 2017 09:21:19 +0200 +Subject: scsi: return correct blkprep status code in case scsi_init_io() fails. + +From: Johannes Thumshirn + +commit e7661a8e5ce10b5321882d0bbaf3f81070903319 upstream. + +When instrumenting the SCSI layer to run into the +!blk_rq_nr_phys_segments(rq) case the following warning emitted from the +block layer: + +blk_peek_request: bad return=-22 + +This happens because since commit fd3fc0b4d730 ("scsi: don't BUG_ON() +empty DMA transfers") we return the wrong error value from +scsi_prep_fn() back to the block layer. + +[mkp: silenced checkpatch] + +Signed-off-by: Johannes Thumshirn +Fixes: fd3fc0b4d730 scsi: don't BUG_ON() empty DMA transfers +Cc: +Reviewed-by: Christoph Hellwig +Reviewed-by: Hannes Reinecke +Reviewed-by: Bart Van Assche +Signed-off-by: Martin K. Petersen +[iwamatsu: - backport for 4.4.y and 4.9.y + - Use rq->nr_phys_segments instead of blk_rq_nr_phys_segments] +Signed-off-by: Nobuhiro Iwamatsu +Signed-off-by: Greg Kroah-Hartman +--- + drivers/scsi/scsi_lib.c | 4 ++-- + 1 file changed, 2 insertions(+), 2 deletions(-) + +--- a/drivers/scsi/scsi_lib.c ++++ b/drivers/scsi/scsi_lib.c +@@ -1029,10 +1029,10 @@ int scsi_init_io(struct scsi_cmnd *cmd) + struct scsi_device *sdev = cmd->device; + struct request *rq = cmd->request; + bool is_mq = (rq->mq_ctx != NULL); +- int error; ++ int error = BLKPREP_KILL; + + if (WARN_ON_ONCE(!rq->nr_phys_segments)) +- return -EINVAL; ++ goto err_exit; + + error = scsi_init_sgtable(rq, &cmd->sdb); + if (error) diff --git a/queue-4.9/series b/queue-4.9/series index 7aa47feaebb..e5184cedc0f 100644 --- a/queue-4.9/series +++ b/queue-4.9/series @@ -1,2 +1,4 @@ ipv6-fix-ipv6_addrform-operation-logic.patch vxlan-avoid-infinite-loop-when-suppressing-ns-messages-with-invalid-options.patch +crypto-talitos-fix-ecb-and-cbc-algs-ivsize.patch +scsi-return-correct-blkprep-status-code-in-case-scsi_init_io-fails.patch