linux/crypto
Laura Abbott 02608e02fb 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: d7db7a882d ("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>
2016-12-27 17:32:11 +08:00
..
asymmetric_keys Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-12-15 11:41:37 -08:00
async_tx
.gitignore
842.c
ablk_helper.c
ablkcipher.c
acompress.c
aead.c
aes_generic.c
af_alg.c
ahash.c
akcipher.c
algapi.c
algboss.c crypto: testmgr - Do not test internal algorithms 2016-11-28 21:23:20 +08:00
algif_aead.c This pull contains one set of changes: a conversion of the crypto DocBook 2016-12-17 16:00:34 -08:00
algif_hash.c
algif_rng.c
algif_skcipher.c Merge branch 'linus' of git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-12-14 13:31:29 -08:00
ansi_cprng.c
anubis.c
api.c crypto: api - Do not clear type bits in crypto_larval_lookup 2016-11-28 21:23:18 +08:00
arc4.c
authenc.c
authencesn.c
blkcipher.c
blowfish_common.c
blowfish_generic.c
camellia_generic.c
cast_common.c
cast5_generic.c
cast6_generic.c
cbc.c crypto: cbc - Export CBC implementation 2016-11-28 21:23:21 +08:00
ccm.c
chacha20_generic.c
chacha20poly1305.c
cipher.c
cmac.c
compress.c
crc32_generic.c
crc32c_generic.c
crct10dif_common.c
crct10dif_generic.c
cryptd.c crypto: cryptd - Add support for skcipher 2016-11-28 21:23:18 +08:00
crypto_engine.c
crypto_null.c
crypto_user.c
crypto_wq.c
ctr.c
cts.c
deflate.c
des_generic.c
dh_helper.c
dh.c
drbg.c Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-11-30 19:53:12 +08:00
ecb.c
ecc_curve_defs.h
ecc.c
ecc.h
ecdh_helper.c
ecdh.c
echainiv.c
fcrypt.c
fips.c
gcm.c
gf128mul.c
ghash-generic.c
hash_info.c
hmac.c
internal.h
jitterentropy-kcapi.c
jitterentropy.c
Kconfig crypto: aesni - Convert to skcipher 2016-11-28 21:23:20 +08:00
keywrap.c
khazad.c
kpp.c
lrw.c crypto: lrw - Convert to skcipher 2016-11-28 21:23:17 +08:00
lz4.c
lz4hc.c
lzo.c
Makefile Merge git://git.kernel.org/pub/scm/linux/kernel/git/herbert/crypto-2.6 2016-11-30 19:53:12 +08:00
mcryptd.c crypto: mcryptd - Check mcryptd algorithm compatibility 2016-12-07 19:55:37 +08:00
md4.c
md5.c
memneq.c
michael_mic.c
pcbc.c crypto: pcbc - Convert to skcipher 2016-11-28 21:23:18 +08:00
pcrypt.c
poly1305_generic.c
proc.c
ripemd.h
rmd128.c
rmd160.c
rmd256.c
rmd320.c
rng.c
rsa_helper.c
rsa-pkcs1pad.c
rsa.c
rsaprivkey.asn1
rsapubkey.asn1
salsa20_generic.c
scatterwalk.c
scompress.c
seed.c
seqiv.c
serpent_generic.c
sha1_generic.c
sha3_generic.c
sha256_generic.c
sha512_generic.c
shash.c
simd.c crypto: simd - Add simd skcipher helper 2016-11-28 21:23:18 +08:00
skcipher.c crypto: skcipher - fix crash in virtual walk 2016-12-14 18:33:14 +08:00
tcrypt.c
tcrypt.h
tea.c
testmgr.c crypto: testmgr - Use heap buffer for acomp test input 2016-12-27 17:32:11 +08:00
testmgr.h crypto: testmgr - add/enhance test cases for CRC-T10DIF 2016-12-07 20:01:15 +08:00
tgr192.c
twofish_common.c
twofish_generic.c
vmac.c
wp512.c
xcbc.c
xor.c
xts.c crypto: xts - Convert to skcipher 2016-11-28 21:23:18 +08:00