From owner-freebsd-current@FreeBSD.ORG Tue Nov 15 01:11:06 2011 Return-Path: Delivered-To: current@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 38DB6106564A for ; Tue, 15 Nov 2011 01:11:06 +0000 (UTC) (envelope-from oliver.pntr@gmail.com) Received: from mail-ey0-f182.google.com (mail-ey0-f182.google.com [209.85.215.182]) by mx1.freebsd.org (Postfix) with ESMTP id C05FE8FC12 for ; Tue, 15 Nov 2011 01:11:04 +0000 (UTC) Received: by eyd10 with SMTP id 10so6762724eyd.13 for ; Mon, 14 Nov 2011 17:11:04 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=gamma; h=mime-version:in-reply-to:references:date:message-id:subject:from:to :content-type; bh=rkFbAbc9KbvJsh1KMM3BYL2M7NNmrlxdXPuvyRYGFHE=; b=C6pnYrCkmPMtZipt+97vHP8SXGQW1ZjPxdkJoiZB+zxuVTHjMV2vhfgsqVatcYJgbK 7XIQlCw2UcfzqQWIUitLWbLBjS6NLM6m5m1pom0K6CCHAVCY8v6aUSMb5qcWnIxRep1b 2iLooAymtw046DpQWqX4D+Ef3loE4wnCVtdWU= MIME-Version: 1.0 Received: by 10.182.124.33 with SMTP id mf1mr2044856obb.24.1321319463892; Mon, 14 Nov 2011 17:11:03 -0800 (PST) Received: by 10.182.42.104 with HTTP; Mon, 14 Nov 2011 17:11:03 -0800 (PST) In-Reply-To: <20111115004443.GA50429@vniz.net> References: <20080916140319.GA34447@nagual.pp.ru> <20080916201932.GA59781@zim.MIT.EDU> <20111112102241.GA75396@vniz.net> <20111112154135.GA21512@zim.MIT.EDU> <20111112171531.GA83419@vniz.net> <20111114013004.GA53392@zim.MIT.EDU> <20111114192721.GA16834@vniz.net> <20111114205855.GB58790@zim.MIT.EDU> <20111114212926.GA28783@vniz.net> <20111114230855.GA59545@zim.MIT.EDU> <20111115004443.GA50429@vniz.net> Date: Tue, 15 Nov 2011 02:11:03 +0100 Message-ID: From: Oliver Pinter To: Andrey Chernov , das@freebsd.org, current@freebsd.org, secteam@freebsd.org Content-Type: text/plain; charset=ISO-8859-1 Cc: Subject: Re: Is fork() hook ever possible? X-BeenThere: freebsd-current@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: Discussions about the use of FreeBSD-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 15 Nov 2011 01:11:06 -0000 On 11/15/11, Andrey Chernov wrote: > On Mon, Nov 14, 2011 at 06:08:55PM -0500, David Schultz wrote: >> Not quite. OpenBSD's implementation is more careful. I just >> noticed a funny thing about FreeBSD's KERN_ARND sysctl: If the >> random device isn't (or can't be) loaded, KERN_ARND silently >> decides to initialize itself with the output of random(). This >> means that whatever minuscule amount of entropy it might have >> picked up from the clock is reduced to a maximum of 31 bits. >> That's a fantastic way to provide a false sense of security... > > I agree. > > Lets separate two things: "no /dev/random for jails" and "no random kernel > module is loaded". > IMHO kernel module should _not_ be optional anymore, it solves problem you > describe and all similar problems at once. > > Adding KERN_ARND to arc4random() at this moment solves "no /dev/random for > jails" problem alone and _not_ pretends to solve "no random kernel module > is loaded" problem. When random kernel module will become non-optional, > KERN_ARND automagically makes good security in that place too. > > P.S. Do I answer your doubts about &rdat key initialization in my prev. > posting? I think it's a much correct solution, rather than the original patch, while it initializes the whole structure, not only the key array... (&rdat.key vs &rdat; and uninitialized pid and tv): fd = _open(RANDOMDEV, O_RDONLY, 0); done = 0; if (fd >= 0) { - if (_read(fd, &rdat, KEYSIZE) == KEYSIZE) + if (_read(fd, &rdat, sizeof(rdat)) == sizeof(rdat)) done = 1; (void)_close(fd); - } + } > > -- > http://ache.vniz.net/ > _______________________________________________ > freebsd-current@freebsd.org mailing list > http://lists.freebsd.org/mailman/listinfo/freebsd-current > To unsubscribe, send any mail to "freebsd-current-unsubscribe@freebsd.org" >