summaryrefslogtreecommitdiff
path: root/lib/locking-selftest-rsem.h
diff options
context:
space:
mode:
authorEric Biggers <ebiggers@google.com>2018-07-23 10:54:58 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2018-08-17 21:01:10 +0200
commit68432fd1665b6c0647cf2cce6c218fea4761a5b4 (patch)
treee3ac80d5ff447b0f7ce06f4480bd41de039ddfab /lib/locking-selftest-rsem.h
parent2cde72d94f0a3a12681e9321a7b9e15b524bf15f (diff)
crypto: ablkcipher - fix crash flushing dcache in error path
commit 318abdfbe708aaaa652c79fb500e9bd60521f9dc upstream. 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 <liuchao741@huawei.com> Fixes: bf06099db18a ("crypto: skcipher - Add ablkcipher_walk interfaces") Cc: <stable@vger.kernel.org> # v2.6.35+ Signed-off-by: Eric Biggers <ebiggers@google.com> Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'lib/locking-selftest-rsem.h')
0 files changed, 0 insertions, 0 deletions