summaryrefslogtreecommitdiff
path: root/crypto/pcrypt.c
diff options
context:
space:
mode:
authorHerbert Xu <herbert@gondor.apana.org.au>2019-09-06 13:13:06 +1000
committerHerbert Xu <herbert@gondor.apana.org.au>2019-09-09 17:35:27 +1000
commitbc139413f5536fea6b8b93d5935e357f3f3ac3a8 (patch)
tree850a22a090d41445540768bebc66d642fe3ee8dd /crypto/pcrypt.c
parent9dfce227a2bafcdbe9e873338c6713fc6f75b824 (diff)
downloadlinux-crypto-bc139413f5536fea6b8b93d5935e357f3f3ac3a8.tar.gz
linux-crypto-bc139413f5536fea6b8b93d5935e357f3f3ac3a8.zip
crypto: skcipher - Unmap pages after an external error
skcipher_walk_done may be called with an error by internal or external callers. For those internal callers we shouldn't unmap pages but for external callers we must unmap any pages that are in use. This patch distinguishes between the two cases by checking whether walk->nbytes is zero or not. For internal callers, we now set walk->nbytes to zero prior to the call. For external callers, walk->nbytes has always been non-zero (as zero is used to indicate the termination of a walk). Reported-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Fixes: 61cea2599a20 ("[CRYPTO] cipher: Added block cipher type") Cc: <stable@vger.kernel.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Tested-by: Ard Biesheuvel <ard.biesheuvel@linaro.org> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Diffstat (limited to '')
0 files changed, 0 insertions, 0 deletions