]> git.baikalelectronics.ru Git - kernel.git/commit
[CRYPTO] xcbc: Fix crash with IPsec
authorJoy Latten <latten@austin.ibm.com>
Thu, 6 Mar 2008 11:28:44 +0000 (19:28 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 6 Mar 2008 11:28:44 +0000 (19:28 +0800)
commitda3e96a3c9ea434f3d7dd9d969b97ad883ecd6b5
tree8b84e1c7a18df7c134d32cbe587cd6d88c9e942e
parente8c5758fe1a83042474c4b03b43b7cd844d38365
[CRYPTO] xcbc: Fix crash with IPsec

When using aes-xcbc-mac for authentication in IPsec,
the kernel crashes. It seems this algorithm doesn't
account for the space IPsec may make in scatterlist for authtag.
Thus when crypto_xcbc_digest_update2() gets called,
nbytes may be less than sg[i].length.
Since nbytes is an unsigned number, it wraps
at the end of the loop allowing us to go back
into loop and causing crash in memcpy.

I used update function in digest.c to model this fix.
Please let me know if it looks ok.

Signed-off-by: Joy Latten <latten@austin.ibm.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/xcbc.c