lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date:   Fri, 18 May 2018 14:57:36 +0800
From:   Herbert Xu <herbert@...dor.apana.org.au>
To:     Theodore Ts'o <tytso@....edu>,
        Linux Kernel Mailing List <linux-kernel@...r.kernel.org>
Subject: random: Wake up writers when random pools are zapped

As it is when the pool is zapped with RNDCLEARPOOL writers are
not woken up and therefore the pool may remain in the empty state
indefinitely.

This patch wakes them up unless the write threshold is set to zero.

Signed-off-by: Herbert Xu <herbert@...dor.apana.org.au>

diff --git a/drivers/char/random.c b/drivers/char/random.c
index e027e7f..32b7010 100644
--- a/drivers/char/random.c
+++ b/drivers/char/random.c
@@ -1874,6 +1874,10 @@ static long random_ioctl(struct file *f, unsigned int cmd, unsigned long arg)
 			return -EPERM;
 		input_pool.entropy_count = 0;
 		blocking_pool.entropy_count = 0;
+		if (random_write_wakeup_bits) {
+			wake_up_interruptible(&random_write_wait);
+			kill_fasync(&fasync, SIGIO, POLL_OUT);
+		}
 		return 0;
 	default:
 		return -EINVAL;
-- 
Email: Herbert Xu <herbert@...dor.apana.org.au>
Home Page: http://gondor.apana.org.au/~herbert/
PGP Key: http://gondor.apana.org.au/~herbert/pubkey.txt

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ