Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
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 <[email protected]> Fixes: 5cde0af ("[CRYPTO] cipher: Added block cipher type") Cc: <[email protected]> Signed-off-by: Herbert Xu <[email protected]> Tested-by: Ard Biesheuvel <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
- Loading branch information