NetBSD Problem Report #51135

From www@NetBSD.org  Fri May 13 13:17:14 2016
Return-Path: <www@NetBSD.org>
Received: from mail.netbsd.org (mail.netbsd.org [199.233.217.200])
	(using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits))
	(Client CN "mail.netbsd.org", Issuer "Postmaster NetBSD.org" (verified OK))
	by mollari.NetBSD.org (Postfix) with ESMTPS id 4FBB87A212
	for <gnats-bugs@gnats.NetBSD.org>; Fri, 13 May 2016 13:17:14 +0000 (UTC)
Message-Id: <20160513131713.33C007A48D@mollari.NetBSD.org>
Date: Fri, 13 May 2016 13:17:13 +0000 (UTC)
From: pooka@iki.fi
Reply-To: pooka@iki.fi
To: gnats-bugs@NetBSD.org
Subject: /dev/random blocks even with entropy available via callback
X-Send-Pr-Version: www-1.0

>Number:         51135
>Category:       kern
>Synopsis:       /dev/random blocks even with entropy available via callback
>Confidential:   no
>Severity:       serious
>Priority:       medium
>Responsible:    riastradh
>State:          closed
>Class:          sw-bug
>Submitter-Id:   net
>Arrival-Date:   Fri May 13 13:20:00 +0000 2016
>Closed-Date:    Sat Dec 17 15:27:33 +0000 2016
>Last-Modified:  Sat Dec 17 15:27:33 +0000 2016
>Originator:     Antti Kantee
>Release:        https://releng.netbsd.org/b5reports/i386/build/2016.05.13.05.45.13/test.html
>Organization:
>Environment:
>Description:
Reading from /dev/random blocks indefinitely even with entropy available from a randomness source via callback.  This problem makes for example "cgdconfig -k storedkey" hang.
>How-To-Repeat:
run tests/kernel/t_rnd::read_random

The test works both with netbsd-7 and -current from ~6 months ago.

>Fix:

>Release-Note:

>Audit-Trail:
From: "Antti Kantee" <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51135 CVS commit: src/sys/rump/dev/lib/librnd
Date: Mon, 16 May 2016 16:31:07 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Mon May 16 16:31:07 UTC 2016

 Modified Files:
 	src/sys/rump/dev/lib/librnd: rnd_component.c

 Log Message:
 Add workaround for PR kern/51135

 If the rnd component is present, load extra initial entropy to avoid
 /dev/random not being able to request it on demand.  The extra initial
 entropy will allow a few instances of /dev/random, but will eventually
 go into the failure mode described in the PR.


 To generate a diff of this commit:
 cvs rdiff -u -r1.3 -r1.4 src/sys/rump/dev/lib/librnd/rnd_component.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51135 CVS commit: src/sys/rump/librump/rumpkern
Date: Sat, 21 May 2016 14:59:45 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat May 21 14:59:45 UTC 2016

 Modified Files:
 	src/sys/rump/librump/rumpkern: hyperentropy.c

 Log Message:
 Actually get as many bytes as requested from rumpuser_random.

 rumpuser_random is limited to 32 bytes at a time -- which would be
 reasonable, except that there are too many buffers in the way between
 entropy sources and users of the entropy pool.

 Partial fix for PR kern/51135.


 To generate a diff of this commit:
 cvs rdiff -u -r1.14 -r1.15 src/sys/rump/librump/rumpkern/hyperentropy.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51135 CVS commit: src/sys/kern
Date: Sat, 21 May 2016 15:27:15 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sat May 21 15:27:15 UTC 2016

 Modified Files:
 	src/sys/kern: kern_rndq.c

 Log Message:
 Ask on-demand entropy sources to produce enough data to fill buffer.

 Remainder of fix for PR kern/51135: if there is an entropy source
 that can produce arbitrarily much data, as in rump, then nothing
 should ever block indefinitely waiting for data.


 To generate a diff of this commit:
 cvs rdiff -u -r1.88 -r1.89 src/sys/kern/kern_rndq.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

Responsible-Changed-From-To: kern-bug-people->riastradh
Responsible-Changed-By: riastradh@NetBSD.org
Responsible-Changed-When: Sat, 21 May 2016 15:42:32 +0000
Responsible-Changed-Why:
mine


State-Changed-From-To: open->feedback
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 21 May 2016 15:42:32 +0000
State-Changed-Why:
Candidate fix committed.  Please test so we can kill the workaround?


From: "Taylor R Campbell" <riastradh@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51135 CVS commit: src/tests/kernel
Date: Sun, 22 May 2016 04:34:44 +0000

 Module Name:	src
 Committed By:	riastradh
 Date:		Sun May 22 04:34:44 UTC 2016

 Modified Files:
 	src/tests/kernel: t_rnd.c

 Log Message:
 Test for PR kern/51135 is no longer failing.


 To generate a diff of this commit:
 cvs rdiff -u -r1.8 -r1.9 src/tests/kernel/t_rnd.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

From: "Antti Kantee" <pooka@netbsd.org>
To: gnats-bugs@gnats.NetBSD.org
Cc: 
Subject: PR/51135 CVS commit: src/sys/rump/dev/lib/librnd
Date: Mon, 30 May 2016 14:52:06 +0000

 Module Name:	src
 Committed By:	pooka
 Date:		Mon May 30 14:52:06 UTC 2016

 Modified Files:
 	src/sys/rump/dev/lib/librnd: rnd_component.c

 Log Message:
 Disable PR kern/51135 hack now that the problem is supposedly
 fixed (to see if tests pass).


 To generate a diff of this commit:
 cvs rdiff -u -r1.4 -r1.5 src/sys/rump/dev/lib/librnd/rnd_component.c

 Please note that diffs are not public domain; they are subject to the
 copyright notices on the relevant files.

State-Changed-From-To: feedback->closed
State-Changed-By: riastradh@NetBSD.org
State-Changed-When: Sat, 17 Dec 2016 15:27:33 +0000
State-Changed-Why:
fixed and tested


>Unformatted:

NetBSD Home
NetBSD PR Database Search

(Contact us) $NetBSD: query-full-pr,v 1.39 2013/11/01 18:47:49 spz Exp $
$NetBSD: gnats_config.sh,v 1.8 2006/05/07 09:23:38 tsutsui Exp $
Copyright © 1994-2014 The NetBSD Foundation, Inc. ALL RIGHTS RESERVED.