[PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page
commit52cf067ab95517b7325fcfede04a31e9ce9f772d
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 11 Sep 2007 02:31:59 +0000 (11 10:31 +0800)
committerWilly Tarreau <w@1wt.eu>
Wed, 17 Oct 2007 19:30:36 +0000 (17 21:30 +0200)
tree7547d13d0bee2fa01803c03ecb77a9a3b0b6aedb
parentc43386160e770cb29e78d370c25d8e1fc51ca260
[PATCH] crypto: blkcipher_get_spot() handling of buffer at end of page

This corresponds to upstream changesets
e4630f9fd8cdc14eb1caa08dafe649eb5ae09985 and
32528d0fbda1093eeeaa7d0a2c498bbb5154099d.

[CRYPTO] blkcipher: Fix handling of kmalloc page straddling

The function blkcipher_get_spot tries to return a buffer of
the specified length that does not straddle a page.  It has
an off-by-one bug so it may advance a page unnecessarily.

What's worse, one of its callers doesn't provide a buffer
that's sufficiently long for this operation.

This patch fixes both problems.  Thanks to Bob Gilligan for
diagnosing this problem and providing a fix.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
crypto/blkcipher.c