Latest commit 02608e0 Dec 22, 2016 @labbott labbott committed with herbertx crypto: testmgr - Use heap buffer for acomp test input
Christopher Covington reported a crash on aarch64 on recent Fedora
kernels:

kernel BUG at ./include/linux/scatterlist.h:140!
Internal error: Oops - BUG: 0 [#1] PREEMPT SMP
Modules linked in:
CPU: 2 PID: 752 Comm: cryptomgr_test Not tainted 4.9.0-11815-ge93b1cc #162
Hardware name: linux,dummy-virt (DT)
task: ffff80007c650080 task.stack: ffff800008910000
PC is at sg_init_one+0xa0/0xb8
LR is at sg_init_one+0x24/0xb8
...
[<ffff000008398db8>] sg_init_one+0xa0/0xb8
[<ffff000008350a44>] test_acomp+0x10c/0x438
[<ffff000008350e20>] alg_test_comp+0xb0/0x118
[<ffff00000834f28c>] alg_test+0x17c/0x2f0
[<ffff00000834c6a4>] cryptomgr_test+0x44/0x50
[<ffff0000080dac70>] kthread+0xf8/0x128
[<ffff000008082ec0>] ret_from_fork+0x10/0x50

The test vectors used for input are part of the kernel image. These
inputs are passed as a buffer to sg_init_one which eventually blows up
with BUG_ON(!virt_addr_valid(buf)). On arm64, virt_addr_valid returns
false for the kernel image since virt_to_page will not return the
correct page. Fix this by copying the input vectors to heap buffer
before setting up the scatterlist.

Reported-by: Christopher Covington <cov@codeaurora.org>
Fixes: d7db7a8 ("crypto: acomp - update testmgr with support for acomp")
Signed-off-by: Laura Abbott <labbott@redhat.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Permalink
..
Failed to load latest commit information.
asymmetric_keys Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git… Dec 15, 2016
async_tx async_pq_val: fix DMA memory leak Oct 5, 2016
.gitignore crypto: rsa - add .gitignore for crypto/*.-asn1.[ch] files Jun 25, 2015
842.c crypto: acomp - add support for 842 via scomp Oct 25, 2016
Kconfig crypto: aesni - Convert to skcipher Nov 28, 2016
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Nov 30, 2016
ablk_helper.c crypto: ablk_helper - Fix cryptd reordering Jun 23, 2016
ablkcipher.c crypto: skcipher - Remove top-level givcipher interface Jul 18, 2016
acompress.c crypto: acomp - add driver-side scomp interface Oct 25, 2016
aead.c crypto: aead - Remove blkcipher null for IV generators Jul 18, 2016
aes_generic.c crypto: add missing crypto module aliases Jan 13, 2015
af_alg.c crypto: af_alg - Forbid bind(2) when nokey child sockets are present Jan 18, 2016
ahash.c crypto: ahash - Add padding in crypto_ahash_extsize Jul 1, 2016
akcipher.c crypto: akcipher - add akcipher declarations needed by templates. Dec 9, 2015
algapi.c crypto: api - Add crypto_inst_setname Jul 1, 2016
algboss.c crypto: testmgr - Do not test internal algorithms Nov 28, 2016
algif_aead.c Merge tag 'docs-4.10-2' of git://git.lwn.net/linux Dec 18, 2016
algif_hash.c crypto: algif_hash - Fix result clobbering in recvmsg Nov 22, 2016
algif_rng.c crypto: algif_rng - Remove obsolete const-removal cast Apr 22, 2015
algif_skcipher.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git… Dec 14, 2016
ansi_cprng.c crypto: ansi_cprng - Convert to new rng interface Apr 22, 2015
anubis.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
api.c crypto: api - Do not clear type bits in crypto_larval_lookup Nov 28, 2016
arc4.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
authenc.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
authencesn.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
blkcipher.c crypto: skcipher - Fix blkcipher walk OOM crash Sep 13, 2016
blowfish_common.c crypto: blowfish - split generic and common c code Sep 22, 2011
blowfish_generic.c crypto: add missing crypto module aliases Jan 13, 2015
camellia_generic.c crypto: add missing crypto module aliases Jan 13, 2015
cast5_generic.c crypto: add missing crypto module aliases Jan 13, 2015
cast6_generic.c crypto: add missing crypto module aliases Jan 13, 2015
cast_common.c crypto: make tables used from assembler __visible Aug 14, 2013
cbc.c crypto: cbc - Export CBC implementation Nov 28, 2016
ccm.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
chacha20_generic.c random: replace non-blocking pool with a Chacha20-based CRNG Jul 3, 2016
chacha20poly1305.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
cipher.c crypto: api - Remove no-op exit_ops code Oct 21, 2016
cmac.c crypto: cmac - fix alignment of 'consts' Oct 21, 2016
compress.c crypto: api - Remove no-op exit_ops code Oct 21, 2016
crc32_generic.c crypto: crc32 - Rename generic implementation Jan 30, 2016
crc32c_generic.c crypto: crc32c - Fix crc32c soft dependency Jan 19, 2016
crct10dif_common.c crypto: crct10dif - Add fallback for broken initrds Sep 12, 2013
crct10dif_generic.c crypto: squash lines for simple wrapper functions Sep 13, 2016
cryptd.c crypto: cryptd - Add support for skcipher Nov 28, 2016
crypto_engine.c crypto: engine - Handle the kthread worker using the new API Oct 25, 2016
crypto_null.c crypto: null - Remove default null blkcipher Jul 18, 2016
crypto_user.c crypto: acomp - add asynchronous compression api Oct 25, 2016
crypto_wq.c crypto: crypto_wq - Fix late crypto work queue initialization Mar 21, 2014
ctr.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
cts.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
deflate.c crypto: acomp - add support for deflate via scomp Oct 25, 2016
des_generic.c crypto: add missing crypto module aliases Jan 13, 2015
dh.c crypto: dh - Consistenly return negative error codes Nov 13, 2016
dh_helper.c crypto: dh - Add DH software implementation Jun 23, 2016
drbg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 Nov 30, 2016
ecb.c crypto: include crypto- module prefix in template Nov 26, 2014
ecc.c crypto: ecdh - make ecdh_shared_secret unique Jun 24, 2016
ecc.h crypto: ecdh - make ecdh_shared_secret unique Jun 24, 2016
ecc_curve_defs.h crypto: ecdh - Add ECDH software support Jun 23, 2016
ecdh.c crypto: ecdh - make ecdh_shared_secret unique Jun 24, 2016
ecdh_helper.c crypto: ecdh - Add ECDH software support Jun 23, 2016
echainiv.c crypto: echainiv - Replace chaining with multiplication Sep 13, 2016
fcrypt.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
fips.c crypto: fips - Move fips_enabled sysctl into fips.c Apr 23, 2015
gcm.c crypto: skcipher - Get rid of crypto_spawn_skcipher2() Nov 1, 2016
gf128mul.c crypto: gf128mul - Zero memory when freeing multiplication table Nov 17, 2016
ghash-generic.c crypto: ghash-generic - move common definitions to a new header file Oct 2, 2016
hash_info.c keys, trusted: select hash algorithm for TPM2 chips Dec 20, 2015
hmac.c crypto: include crypto- module prefix in template Nov 26, 2014
internal.h crypto: api - Remove no-op exit_ops code Oct 21, 2016
jitterentropy-kcapi.c crypto: jitterentropy - drop duplicate header module.h Nov 17, 2016
jitterentropy.c crypto: jitterentropy - Delete unnecessary checks before the function… Jun 25, 2015
keywrap.c crypto: keywrap - memzero the correct memory Feb 1, 2016
khazad.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
kpp.c crypto: kpp - Key-agreement Protocol Primitives API (KPP) Jun 23, 2016
lrw.c crypto: lrw - Convert to skcipher Nov 28, 2016
lz4.c crypto: acomp - add support for lz4 via scomp Oct 25, 2016
lz4hc.c crypto: acomp - add support for lz4hc via scomp Oct 25, 2016
lzo.c crypto: acomp - add support for lzo via scomp Oct 25, 2016
mcryptd.c crypto: mcryptd - Check mcryptd algorithm compatibility Dec 7, 2016
md4.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
md5.c crypto: hash - add zero length message hash for shax and md5 Dec 22, 2015
memneq.c crypto: memneq - fix for archs without efficient unaligned access Dec 9, 2013
michael_mic.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
pcbc.c crypto: pcbc - Convert to skcipher Nov 28, 2016
pcrypt.c crypto: aead - Remove CRYPTO_ALG_AEAD_NEW flag Aug 17, 2015
poly1305_generic.c crypto: poly1305 - Use unaligned access where required Nov 13, 2016
proc.c crypto: fips - Move fips_enabled sysctl into fips.c Apr 23, 2015
ripemd.h [CRYPTO] ripemd: Put all common RIPEMD values in header file Jul 10, 2008
rmd128.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
rmd160.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
rmd256.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
rmd320.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
rng.c crypto: rng - Do not free default RNG when it becomes unused Jun 22, 2015
rsa-pkcs1pad.c crypto: rsa-pkcs1pad - Handle leading zero for decryption Sep 22, 2016
rsa.c crypto: rsa - Generate fixed-length output Jul 1, 2016
rsa_helper.c crypto: rsa - allow keys >= 2048 bits in FIPS mode Aug 24, 2016
rsaprivkey.asn1 crypto: rsa - Store rest of the private key components Jul 5, 2016
rsapubkey.asn1 crypto: akcipher - Changes to asymmetric key API Oct 14, 2015
salsa20_generic.c crypto: add missing crypto module aliases Jan 13, 2015
scatterwalk.c crypto: scatterwalk - Remove unnecessary aliasing check in map_and_copy Nov 22, 2016
scompress.c crypto: acomp - add driver-side scomp interface Oct 25, 2016
seed.c crypto: prefix module autoloading with "crypto-" Nov 24, 2014
seqiv.c crypto: skcipher - Remove top-level givcipher interface Jul 18, 2016
serpent_generic.c crypto: add missing crypto module aliases Jan 13, 2015
sha1_generic.c crypto: hash - add zero length message hash for shax and md5 Dec 22, 2015
sha256_generic.c crypto: hash - add zero length message hash for shax and md5 Dec 22, 2015
sha3_generic.c crypto: sha3 - Add missing ULL suffixes for 64-bit constants Aug 8, 2016
sha512_generic.c crypto: sha512-generic - move to generic glue implementation Apr 10, 2015
shash.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git… Mar 17, 2016
simd.c crypto: simd - Add simd skcipher helper Nov 28, 2016
skcipher.c crypto: skcipher - fix crash in virtual walk Dec 14, 2016
tcrypt.c crypto: sha3 - Add HMAC-SHA3 test modes and test vectors Jul 1, 2016
tcrypt.h crypto: tcrypt - Add ChaCha20/Poly1305 speed tests Jul 17, 2015
tea.c crypto: add missing crypto module aliases Jan 13, 2015
testmgr.c crypto: testmgr - Use heap buffer for acomp test input Dec 27, 2016
testmgr.h crypto: testmgr - add/enhance test cases for CRC-T10DIF Dec 7, 2016
tgr192.c crypto: add missing crypto module aliases Jan 13, 2015
twofish_common.c crypto: twofish-x86_64-3way - add lrw support Nov 9, 2011
twofish_generic.c crypto: add missing crypto module aliases Jan 13, 2015
vmac.c crypto: include crypto- module prefix in template Nov 26, 2014
wp512.c crypto: add missing crypto module aliases Jan 13, 2015
xcbc.c crypto: include crypto- module prefix in template Nov 26, 2014
xor.c crypto: xor - Fix warning when XOR_SELECT_TEMPLATE is unset Aug 31, 2016
xts.c crypto: xts - Convert to skcipher Nov 28, 2016