Skip to content

Commit 7996094

Browse files
iokillherbertx
authored andcommitted
crypto: talitos - Fix timing leak in ESP ICV verification
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. Cc: stable@vger.kernel.org Signed-off-by: David Gstir <david@sigma-star.at> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
1 parent cb8affb commit 7996094

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/crypto/talitos.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -977,7 +977,7 @@ static void ipsec_esp_decrypt_swauth_done(struct device *dev,
977977
} else
978978
oicv = (char *)&edesc->link_tbl[0];
979979

980-
err = memcmp(oicv, icv, authsize) ? -EBADMSG : 0;
980+
err = crypto_memneq(oicv, icv, authsize) ? -EBADMSG : 0;
981981
}
982982

983983
kfree(edesc);

0 commit comments

Comments
 (0)