Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux
1
fork

Configure Feed

Select the types of activity you want to include in your feed.

crypto: drbg - always try to free Jitter RNG instance

The Jitter RNG is unconditionally allocated as a seed source follwoing
the patch 97f2650e5040. Thus, the instance must always be deallocated.

Reported-by: syzbot+2e635807decef724a1fa@syzkaller.appspotmail.com
Fixes: 97f2650e5040 ("crypto: drbg - always seeded with SP800-90B ...")
Signed-off-by: Stephan Mueller <smueller@chronox.de>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>

authored by

Stephan Müller and committed by
Herbert Xu
819966c0 1f5b07f5

+4 -2
+4 -2
crypto/drbg.c
··· 1631 1631 if (drbg->random_ready.func) { 1632 1632 del_random_ready_callback(&drbg->random_ready); 1633 1633 cancel_work_sync(&drbg->seed_work); 1634 - crypto_free_rng(drbg->jent); 1635 - drbg->jent = NULL; 1636 1634 } 1635 + 1636 + if (!IS_ERR_OR_NULL(drbg->jent)) 1637 + crypto_free_rng(drbg->jent); 1638 + drbg->jent = NULL; 1637 1639 1638 1640 if (drbg->d_ops) 1639 1641 drbg->d_ops->crypto_fini(drbg);