From: David Gstir Date: Sun, 15 Nov 2015 16:14:42 +0000 (+0100) Subject: crypto: talitos - Fix timing leak in ESP ICV verification X-Git-Tag: v4.3.6~195 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=1f8b52002e010be989eb2e02bd0c90b65bdb3683;p=thirdparty%2Fkernel%2Fstable.git crypto: talitos - Fix timing leak in ESP ICV verification commit 79960943fdc114fd4583c9ab164b5c89da7aa601 upstream. Using non-constant time memcmp() makes the verification of the authentication tag in the decrypt path vulnerable to timing attacks. Fix this by using crypto_memneq() instead. Signed-off-by: David Gstir Signed-off-by: Herbert Xu Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/crypto/talitos.c b/drivers/crypto/talitos.c index 3b20a1bce703f..8b327d89a8fc9 100644 --- a/drivers/crypto/talitos.c +++ b/drivers/crypto/talitos.c @@ -1015,7 +1015,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev, } else oicv = (char *)&edesc->link_tbl[0]; - err = memcmp(oicv, icv, authsize) ? -EBADMSG : 0; + err = crypto_memneq(oicv, icv, authsize) ? -EBADMSG : 0; } kfree(edesc);