]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: algif_skcipher - Handle unaligned receive buffer
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 30 Nov 2010 09:04:31 +0000 (17:04 +0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Tue, 30 Nov 2010 09:04:31 +0000 (17:04 +0800)
commit55a523a4581dffe2f93257cb91bb084cae9afcd9
tree470a1564aaa3d36f545bb7b4d25e853a38617f01
parent1d0cc7e98980178d98b99ec27e4a0cfa93feb468
crypto: algif_skcipher - Handle unaligned receive buffer

As it is if user-space passes through a receive buffer that's not
aligned to to the cipher block size, we'll end up encrypting or
decrypting a partial block which causes a spurious EINVAL to be
returned.

This patch fixes this by moving the partial block test after the
af_alg_make_sg call.

Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/algif_skcipher.c