]> git.karo-electronics.de Git - karo-tx-linux.git/commit
CRYPTO: api: Fix scatterwalk_sg_chain
authorHerbert Xu <herbert@gondor.apana.org.au>
Tue, 6 May 2008 06:01:23 +0000 (14:01 +0800)
committerGreg Kroah-Hartman <gregkh@suse.de>
Sat, 10 May 2008 04:40:51 +0000 (21:40 -0700)
commitf69af5c3a887b65da440726968d7c68218a347d6
tree00e2c3437049a88c3e33ccce300702cc69aa1f86
parent215f6f246d56d0bbaecc8aadaa630a3c0bd5ac2e
CRYPTO: api: Fix scatterwalk_sg_chain

[CRYPTO] api: Fix scatterwalk_sg_chain

[ Upstream commit: 8ec970d8561abb5645d4602433b772e268c96d05 ]

When I backed out of using the generic sg chaining (as it isn't currently
portable) and introduced scatterwalk_sg_chain/scatterwalk_sg_next I left
out the sg_is_last check in the latter.  This causes it to potentially
dereference beyond the end of the sg array.

As most uses of scatterwalk_sg_next are bound by an overall length, this
only affected the chaining code in authenc and eseqiv. Thanks to Patrick
McHardy for identifying this problem.

This patch also clears the "last" bit on the head of the chained list as
it's no longer last.  This also went missing in scatterwalk_sg_chain and
is present in sg_chain.

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