]> git.baikalelectronics.ru Git - kernel.git/commit
crypto: x86/chacha - avoid sleeping under kernel_fpu_begin()
authorEric Biggers <ebiggers@google.com>
Sat, 15 Dec 2018 20:40:17 +0000 (12:40 -0800)
committerHerbert Xu <herbert@gondor.apana.org.au>
Sun, 23 Dec 2018 03:52:44 +0000 (11:52 +0800)
commit943645b39cd9fba2e5665e785dda00c22bcbafee
tree880c29e660d78a9cd191af522a0068a9c62f7731
parent9bf8ada9e5b51a6109c11cb03cb355bf7ea2155a
crypto: x86/chacha - avoid sleeping under kernel_fpu_begin()

Passing atomic=true to skcipher_walk_virt() only makes the later
skcipher_walk_done() calls use atomic memory allocations, not
skcipher_walk_virt() itself.  Thus, we have to move it outside of the
preemption-disabled region (kernel_fpu_begin()/kernel_fpu_end()).

(skcipher_walk_virt() only allocates memory for certain layouts of the
input scatterlist, hence why I didn't notice this earlier...)

Reported-by: syzbot+9bf843c33f782d73ae7d@syzkaller.appspotmail.com
Fixes: f562887c7028 ("crypto: x86/chacha20 - add XChaCha20 support")
Signed-off-by: Eric Biggers <ebiggers@google.com>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
arch/x86/crypto/chacha_glue.c