aboutsummaryrefslogtreecommitdiffstats
path: root/lib/mpi/mpi-pow.c
diff options
context:
space:
mode:
authorEric Biggers <[email protected]>2018-07-23 17:54:58 +0000
committerHerbert Xu <[email protected]>2018-08-03 10:06:04 +0000
commit318abdfbe708aaaa652c79fb500e9bd60521f9dc (patch)
tree37e2e89d56b6d5e057ee515c50ade51e4406b3b2 /lib/mpi/mpi-pow.c
parentcrypto: blkcipher - fix crash flushing dcache in error path (diff)
downloadkernel-318abdfbe708aaaa652c79fb500e9bd60521f9dc.tar.gz
kernel-318abdfbe708aaaa652c79fb500e9bd60521f9dc.zip
crypto: ablkcipher - fix crash flushing dcache in error path
Like the skcipher_walk and blkcipher_walk cases: scatterwalk_done() is only meant to be called after a nonzero number of bytes have been processed, since scatterwalk_pagedone() will flush the dcache of the *previous* page. But in the error case of ablkcipher_walk_done(), e.g. if the input wasn't an integer number of blocks, scatterwalk_done() was actually called after advancing 0 bytes. This caused a crash ("BUG: unable to handle kernel paging request") during '!PageSlab(page)' on architectures like arm and arm64 that define ARCH_IMPLEMENTS_FLUSH_DCACHE_PAGE, provided that the input was page-aligned as in that case walk->offset == 0. Fix it by reorganizing ablkcipher_walk_done() to skip the scatterwalk_advance() and scatterwalk_done() if an error has occurred. Reported-by: Liu Chao <[email protected]> Fixes: bf06099db18a ("crypto: skcipher - Add ablkcipher_walk interfaces") Cc: <[email protected]> # v2.6.35+ Signed-off-by: Eric Biggers <[email protected]> Signed-off-by: Herbert Xu <[email protected]>
Diffstat (limited to 'lib/mpi/mpi-pow.c')
0 files changed, 0 insertions, 0 deletions