NetBSD-Bugs archive

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

PR/48028 CVS commit: src/sys/dev

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

From: "Taylor R Campbell" <>
Subject: PR/48028 CVS commit: src/sys/dev
Date: Sun, 21 Jul 2013 22:30:19 +0000

 Module Name:   src
 Committed By:  riastradh
 Date:          Sun Jul 21 22:30:19 UTC 2013
 Modified Files:
        src/sys/dev: rndpseudo.c
 Log Message:
 When reading from /dev/random, block at most once in cprng_strong.
 We are not obligated to return exactly as many bytes as requested,
 and many applications -- notably those that use stdio or otherwise
 buffered I/O to read from /dev/random -- try to read many more than
 32 bytes at a time from /dev/random even if all they are about to use
 is 32 bytes.
 In this case, blocking until we have enough entropy to fill a large
 buffer causes needless application delays, e.g. causing cgdconfig
 (which reads from /dev/random with stdio) to hang at boot when trying
 to configure a random-keyed device for swap.
 Patch tested by Aran Clauson.  Fixes PR kern/48028.
 To generate a diff of this commit:
 cvs rdiff -u -r1.15 -r1.16 src/sys/dev/rndpseudo.c
 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Home | Main Index | Thread Index | Old Index