From owner-svn-src-head@freebsd.org Mon Apr 13 08:42:14 2020 Return-Path: Delivered-To: svn-src-head@mailman.nyi.freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2610:1c1:1:606c::19:1]) by mailman.nyi.freebsd.org (Postfix) with ESMTP id CD5D62B728A; Mon, 13 Apr 2020 08:42:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from mxrelay.nyi.freebsd.org (mxrelay.nyi.freebsd.org [IPv6:2610:1c1:1:606c::19:3]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) server-signature RSA-PSS (4096 bits) client-signature RSA-PSS (4096 bits) client-digest SHA256) (Client CN "mxrelay.nyi.freebsd.org", Issuer "Let's Encrypt Authority X3" (verified OK)) by mx1.freebsd.org (Postfix) with ESMTPS id 4912DQ59Ddz4HkP; Mon, 13 Apr 2020 08:42:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org (repo.freebsd.org [IPv6:2610:1c1:1:6068::e6a:0]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (Client did not present a certificate) by mxrelay.nyi.freebsd.org (Postfix) with ESMTPS id AAFAB187B1; Mon, 13 Apr 2020 08:42:14 +0000 (UTC) (envelope-from delphij@FreeBSD.org) Received: from repo.freebsd.org ([127.0.1.37]) by repo.freebsd.org (8.15.2/8.15.2) with ESMTP id 03D8gEVB088666; Mon, 13 Apr 2020 08:42:14 GMT (envelope-from delphij@FreeBSD.org) Received: (from delphij@localhost) by repo.freebsd.org (8.15.2/8.15.2/Submit) id 03D8gEV4088663; Mon, 13 Apr 2020 08:42:14 GMT (envelope-from delphij@FreeBSD.org) Message-Id: <202004130842.03D8gEV4088663@repo.freebsd.org> X-Authentication-Warning: repo.freebsd.org: delphij set sender to delphij@FreeBSD.org using -f From: Xin LI Date: Mon, 13 Apr 2020 08:42:13 +0000 (UTC) To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r359849 - head/lib/libc/gen X-SVN-Group: head X-SVN-Commit-Author: delphij X-SVN-Commit-Paths: head/lib/libc/gen X-SVN-Commit-Revision: 359849 X-SVN-Commit-Repository: base MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-BeenThere: svn-src-head@freebsd.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: SVN commit messages for the src tree for head/-current List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 13 Apr 2020 08:42:14 -0000 Author: delphij Date: Mon Apr 13 08:42:13 2020 New Revision: 359849 URL: https://svnweb.freebsd.org/changeset/base/359849 Log: Sync with OpenBSD: arc4random.c: In the incredibly unbelievable circumstance where _rs_init() fails to allocate pages, don't call abort() because of corefile data leakage concerns, but simply _exit(). The reasoning is _rs_init() will only fail if someone finds a way to apply specific pressure against this failure point, for the purpose of leaking information into a core which they can read. We don't need a corefile in this instance to debug that. So take this "lever" away from whoever in the future wants to do that. arc4random.3: reference random(4) arc4random_uniform.c: include stdint.h over sys/types.h Modified: head/lib/libc/gen/arc4random.3 head/lib/libc/gen/arc4random.c head/lib/libc/gen/arc4random_uniform.c Modified: head/lib/libc/gen/arc4random.3 ============================================================================== --- head/lib/libc/gen/arc4random.3 Mon Apr 13 08:41:24 2020 (r359848) +++ head/lib/libc/gen/arc4random.3 Mon Apr 13 08:42:13 2020 (r359849) @@ -1,4 +1,4 @@ -.\" $OpenBSD: arc4random.3,v 1.35 2014/11/25 16:45:24 millert Exp $ +.\" $OpenBSD: arc4random.3,v 1.37 2019/09/29 16:30:35 jmc Exp $ .\" .\" Copyright 1997 Niels Provos .\" All rights reserved. @@ -31,7 +31,7 @@ .\" Manual page, using -mandoc macros .\" $FreeBSD$ .\" -.Dd April 10, 2020 +.Dd April 13, 2020 .Dt ARC4RANDOM 3 .Os .Sh NAME @@ -71,7 +71,9 @@ On each call, a cryptographic pseudo-random number gen to generate a new result. One data pool is used for all consumers in a process, so that consumption under program flow can act as additional stirring. -The subsystem is re-seeded from the kernel random number subsystem using +The subsystem is re-seeded from the kernel +.Xr random 4 +subsystem using .Xr getentropy 2 on a regular basis, and also upon .Xr fork 2 . Modified: head/lib/libc/gen/arc4random.c ============================================================================== --- head/lib/libc/gen/arc4random.c Mon Apr 13 08:41:24 2020 (r359848) +++ head/lib/libc/gen/arc4random.c Mon Apr 13 08:42:13 2020 (r359849) @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random.c,v 1.54 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: arc4random.c,v 1.55 2019/03/24 17:56:54 deraadt Exp $ */ /* * Copyright (c) 1996, David Mazieres @@ -84,7 +84,7 @@ _rs_init(u_char *buf, size_t n) if (rs == NULL) { if (_rs_allocate(&rs, &rsx) == -1) - abort(); + _exit(1); } chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8); Modified: head/lib/libc/gen/arc4random_uniform.c ============================================================================== --- head/lib/libc/gen/arc4random_uniform.c Mon Apr 13 08:41:24 2020 (r359848) +++ head/lib/libc/gen/arc4random_uniform.c Mon Apr 13 08:42:13 2020 (r359849) @@ -1,4 +1,4 @@ -/* $OpenBSD: arc4random_uniform.c,v 1.2 2015/09/13 08:31:47 guenther Exp $ */ +/* $OpenBSD: arc4random_uniform.c,v 1.3 2019/01/20 02:59:07 bcook Exp $ */ /* * Copyright (c) 2008, Damien Miller @@ -18,7 +18,7 @@ * $FreeBSD$ */ -#include +#include #include /*