]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: adiantum - initialize crypto_spawn::inst
authorEric Biggers <ebiggers@google.com>
Sun, 6 Jan 2019 20:46:05 +0000 (12:46 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Thu, 10 Jan 2019 13:37:31 +0000 (21:37 +0800)
commitdb7af71d7056a68868b7de2a065d374bd40d789b
treea54c32b7655a47c8c8a45604b45d65f3990a0a3c
parentae939aaddeb52fb487a0cfa38e0d97ba5b3f4434
crypto: adiantum - initialize crypto_spawn::inst

crypto_grab_*() doesn't set crypto_spawn::inst, so templates must set it
beforehand.  Otherwise it will be left NULL, which causes a crash in
certain cases where algorithms are dynamically loaded/unloaded.  E.g.
with CONFIG_CRYPTO_CHACHA20_X86_64=m, the following caused a crash:

    insmod chacha-x86_64.ko
    python -c 'import socket; socket.socket(socket.AF_ALG, 5, 0).bind(("skcipher", "adiantum(xchacha12,aes)"))'
    rmmod chacha-x86_64.ko
    python -c 'import socket; socket.socket(socket.AF_ALG, 5, 0).bind(("skcipher", "adiantum(xchacha12,aes)"))'

Fixes: 8b2281d1c5cc ("crypto: adiantum - add Adiantum support")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
crypto/adiantum.c