NetBSD-Bugs archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

Re: bin/55783: rndctl -L broken



The following reply was made to PR bin/55783; it has been noted by GNATS.

From: Taylor R Campbell <riastradh%NetBSD.org@localhost>
To: gnats-bugs%NetBSD.org@localhost
Cc: 
Subject: Re: bin/55783: rndctl -L broken
Date: Tue, 12 Jan 2021 06:58:38 +0000

 The patch below might improve it.  Need to make sure it doesn't cause
 overlapping output like <https://gnats.netbsd.org/55458>, though.
 
 
 diff -r 039916e1f0c6 share/man/man4/rnd.4
 --- a/share/man/man4/rnd.4	Sun Jan 10 18:19:10 2021 +0000
 +++ b/share/man/man4/rnd.4	Tue Jan 12 06:56:24 2021 +0000
 @@ -628,6 +628,13 @@ A buggy bootloader tried to provide an e
  the kernel.
  Subsequent seeds will be entered into the entropy pool, but they will
  be considered to contribute no entropy.
 +.It entropy: already seeded
 +A seed was loaded with
 +.Dv RNDADDDATA
 +.Pq e.g., via Ic rndctl -L
 +a second time, or after the bootloader already provided a seed.
 +The seed will be entered into the pool, but it will be considered to
 +contribute no entropy, in case it was actually using the same file.
  .It entropy: ready
  The system has full entropy for the first time.
  .El
 diff -r 039916e1f0c6 sys/kern/kern_entropy.c
 --- a/sys/kern/kern_entropy.c	Sun Jan 10 18:19:10 2021 +0000
 +++ b/sys/kern/kern_entropy.c	Tue Jan 12 06:56:24 2021 +0000
 @@ -2313,7 +2313,9 @@ entropy_ioctl(unsigned long cmd, void *d
  		 */
  		if (privileged && rdata->entropy && rdata->len) {
  			mutex_enter(&E->lock);
 -			if (!E->seeded) {
 +			if (E->seeded) {
 +				printf("entropy: already seeded\n");
 +			} else {
  				entropybits = MIN(rdata->entropy,
  				    MIN(rdata->len, ENTROPY_CAPACITY)*NBBY);
  				E->seeded = true;
 


Home | Main Index | Thread Index | Old Index