]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: hash - Fix handling of small unaligned buffers
authorSzilveszter Ördög <slipszi@gmail.com>
Fri, 6 Aug 2010 01:26:38 +0000 (09:26 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Fri, 6 Aug 2010 01:26:38 +0000 (09:26 +0800)
commit50f736e62547d04055d34c0b41a871e2ee645e62
tree6427c53a261840661f135b99d81062fc015dd571
parent75529ebeb26fbdf78ec4f0302f0a213db25c78bb
crypto: hash - Fix handling of small unaligned buffers

If a scatterwalk chain contains an entry with an unaligned offset then
hash_walk_next() will cut off the next step at the next alignment point.

However, if the entry ends before the next alignment point then we a loop,
which leads to a kernel oops.

Fix this by checking whether the next aligment point is before the end of the
current entry.

Signed-off-by: Szilveszter Ördög <slipszi@gmail.com>
Acked-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/ahash.c