From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail.linuxfoundation.org ([140.211.169.12]:56102 "EHLO mail.linuxfoundation.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751405AbdKFJM7 (ORCPT ); Mon, 6 Nov 2017 04:12:59 -0500 Subject: Patch "s390/crypto: Extend key length check for AES-XTS in fips mode." has been added to the 4.9-stable tree To: freude@linux.vnet.ibm.com, alexander.levin@verizon.com, gregkh@linuxfoundation.org, schwidefsky@de.ibm.com Cc: , From: Date: Mon, 06 Nov 2017 10:11:48 +0100 Message-ID: <150995950815964@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=ANSI_X3.4-1968 Content-Transfer-Encoding: 8bit Sender: stable-owner@vger.kernel.org List-ID: This is a note to let you know that I've just added the patch titled s390/crypto: Extend key length check for AES-XTS in fips mode. to the 4.9-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: s390-crypto-extend-key-length-check-for-aes-xts-in-fips-mode.patch and it can be found in the queue-4.9 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let know about it. >>From foo@baz Mon Nov 6 10:07:36 CET 2017 From: Harald Freudenberger Date: Sat, 7 Oct 2017 22:36:57 +0000 Subject: s390/crypto: Extend key length check for AES-XTS in fips mode. From: Harald Freudenberger [ Upstream commit a4f2779ecf2f42b0997fedef6fd20a931c40a3e3 ] In fips mode only xts keys with 128 bit or 125 bit are allowed. This fix extends the xts_aes_set_key function to check for these valid key lengths in fips mode. Signed-off-by: Harald Freudenberger Signed-off-by: Martin Schwidefsky Signed-off-by: Sasha Levin Signed-off-by: Greg Kroah-Hartman --- arch/s390/crypto/aes_s390.c | 7 +++++++ 1 file changed, 7 insertions(+) --- a/arch/s390/crypto/aes_s390.c +++ b/arch/s390/crypto/aes_s390.c @@ -28,6 +28,7 @@ #include #include #include +#include #include #include @@ -501,6 +502,12 @@ static int xts_aes_set_key(struct crypto if (err) return err; + /* In fips mode only 128 bit or 256 bit keys are valid */ + if (fips_enabled && key_len != 32 && key_len != 64) { + tfm->crt_flags |= CRYPTO_TFM_RES_BAD_KEY_LEN; + return -EINVAL; + } + /* Pick the correct function code based on the key length */ fc = (key_len == 32) ? CPACF_KM_XTS_128 : (key_len == 64) ? CPACF_KM_XTS_256 : 0; Patches currently in stable-queue which might be from freude@linux.vnet.ibm.com are queue-4.9/s390-crypto-extend-key-length-check-for-aes-xts-in-fips-mode.patch queue-4.9/s390-prng-adjust-generation-of-entropy-to-produce-real-256-bits.patch