Skip to contentSkip to conversation

Patch "crypto: crypto4xx - perform aead icv check in the driver" has been added to the 4.15-stable tree

PATCH [email protected] 1 participant 1 message Apr 9, 2018

Subsystems (2)
lore
Share & tools
lore

[email protected]

author maintainer Applied
#0 lore raw

This is a note to let you know that I've just added the patch titled

crypto: crypto4xx - perform aead icv check in the driver

to the 4.15-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:
crypto-crypto4xx-perform-aead-icv-check-in-the-driver.patch
and it can be found in the queue-4.15 subdirectory.

If you, or anyone else, feels it should not be added to the stable tree, please let <[email protected]> know about it.

Quoted 1 line

From foo@baz Mon Apr 9 10:16:32 CEST 2018

From: Christian Lamparter <[email protected]>
Date: Sat, 23 Dec 2017 19:45:46 +0100
Subject: crypto: crypto4xx - perform aead icv check in the driver

From: Christian Lamparter <[email protected]>

[ Upstream commit 0b5a7f71b4c557b15ec54a1b49023bc1b21044cc ]

The ccm-aes-ppc4xx now fails one of testmgr's expected failure test cases as such:

|decryption failed on test 10 for ccm-aes-ppc4xx:
|ret was 0, |expected -EBADMSG

It doesn't look like the hardware sets the authentication failure flag. The original vendor source from which this was ported does not have any special code or notes about why this would happen or if there are any WAs.

Hence, this patch converts the aead_done callback handler to perform the icv check in the driver. And this fixes the false negative and the ccm-aes-ppc4xx passes the selftests once again.

|name         : ccm(aes)
|driver       : ccm-aes-ppc4xx
|module       : crypto4xx
|priority     : 300
|refcnt       : 1
|selftest     : passed
|internal     : no
|type         : aead
|async        : yes
|blocksize    : 1
|ivsize       : 16
|maxauthsize  : 16
|geniv        : <none>
---
 drivers/crypto/amcc/crypto4xx_alg.c  |    6 ---
 drivers/crypto/amcc/crypto4xx_core.c |   54 +++++++++++++++++------------------
 2 files changed, 28 insertions(+), 32 deletions(-)
drivers/crypto/amcc/crypto4xx_alg.c +1 -5
@@ -256,10 +256,6 @@ static inline bool crypto4xx_aead_need_f
 	if (is_ccm && !(req->iv[0] == 1 || req->iv[0] == 3))
 		return true;
 
-	/* CCM - fix CBC MAC mismatch in special case */
-	if (is_ccm && decrypt && !req->assoclen)
-		return true;
-
 	return false;
 }
 
@@ -330,7 +326,7 @@ int crypto4xx_setkey_aes_ccm(struct cryp
 	sa = (struct dynamic_sa_ctl *) ctx->sa_in;
 	sa->sa_contents.w = SA_AES_CCM_CONTENTS | (keylen << 2);
 
-	set_dynamic_sa_command_0(sa, SA_NOT_SAVE_HASH, SA_NOT_SAVE_IV,
+	set_dynamic_sa_command_0(sa, SA_SAVE_HASH, SA_NOT_SAVE_IV,
 				 SA_LOAD_HASH_FROM_SA, SA_LOAD_IV_FROM_STATE,
 				 SA_NO_HEADER_PROC, SA_HASH_ALG_CBC_MAC,
 				 SA_CIPHER_ALG_AES,
drivers/crypto/amcc/crypto4xx_core.c +27 -27

80 lines not on this page · raw message

Patches currently in stable-queue which might be from [email protected] are

queue-4.15/crypto-crypto4xx-perform-aead-icv-check-in-the-driver.patch