From owner-cvs-src-old@FreeBSD.ORG Tue Oct 20 16:38:12 2009 Return-Path: Delivered-To: cvs-src-old@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id C91A91065670 for ; Tue, 20 Oct 2009 16:38:12 +0000 (UTC) (envelope-from ru@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id B6DA28FC16 for ; Tue, 20 Oct 2009 16:38:12 +0000 (UTC) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n9KGcCtV072309 for ; Tue, 20 Oct 2009 16:38:12 GMT (envelope-from ru@repoman.freebsd.org) Received: (from svn2cvs@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n9KGcCcq072308 for cvs-src-old@freebsd.org; Tue, 20 Oct 2009 16:38:12 GMT (envelope-from ru@repoman.freebsd.org) Message-Id: <200910201638.n9KGcCcq072308@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: svn2cvs set sender to ru@repoman.freebsd.org using -f From: Ruslan Ermilov Date: Tue, 20 Oct 2009 16:36:51 +0000 (UTC) To: cvs-src-old@freebsd.org X-FreeBSD-CVS-Branch: HEAD Subject: cvs commit: src/sys/kern init_main.c stack_protector.c src/sys/sys kernel.h X-BeenThere: cvs-src-old@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: **OBSOLETE** CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 20 Oct 2009 16:38:12 -0000 ru 2009-10-20 16:36:51 UTC FreeBSD src repository Modified files: sys/kern init_main.c stack_protector.c sys/sys kernel.h Log: SVN rev 198295 on 2009-10-20 16:36:51Z by ru Random number generator initialization cleanup: - Introduce new SI_SUB_RANDOM point in boot sequence to make it clear from where one may start using random(9). It should be as early as possible, so place it just after SI_SUB_CPU where we have some randomness on most platforms via get_cyclecount(). - Move stack protector initialization to be after SI_SUB_RANDOM as before this point we have no randomness at all. This fixes stack protector to actually protect stack with some random guard value instead of a well-known one. Note that this patch doesn't try to address arc4random(9) issues. With current code, it will be implicitly seeded by stack protector and hence will get the same entropy as random(9). It will be securely reseeded once /dev/random is feeded by some entropy from userland. Submitted by: Maxim Dounin MFC after: 3 days Revision Changes Path 1.307 +13 -0 src/sys/kern/init_main.c 1.3 +1 -2 src/sys/kern/stack_protector.c 1.151 +1 -0 src/sys/sys/kernel.h