]> git.hungrycats.org Git - linux/commit
crypto: gcm - Fix rfc4543 decryption crash
authorHerbert Xu <herbert@gondor.apana.org.au>
Fri, 18 Mar 2016 14:42:40 +0000 (22:42 +0800)
committerBen Hutchings <ben@decadent.org.uk>
Sat, 30 Apr 2016 22:06:15 +0000 (00:06 +0200)
commite5393d8034ab710f2797d0c2a15dab663cb60707
tree10e6796249471021042b34f0e9c3172465cd7731
parent366d36a8136fd4b34f6d30935693cb6b85915a25
crypto: gcm - Fix rfc4543 decryption crash

This bug has already bee fixed upstream since 4.2.  However, it
was fixed during the AEAD conversion so no fix was backported to
the older kernels.

[bwh: The upstream commit was adcbc688fe2f ("crypto: gcm - Convert to
new AEAD interface")]

When we do an RFC 4543 decryption, we will end up writing the
ICV beyond the end of the dst buffer.  This should lead to a
crash but for some reason it was never noticed.

This patch fixes it by only writing back the ICV for encryption.

Fixes: d733ac90f9fe ("crypto: gcm - fix rfc4543 to handle async...")
Reported-by: Patrick Meyer <patrick.meyer@vasgard.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/gcm.c