From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2155) id 756CC385AC2E; Sat, 10 Sep 2022 19:01:40 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 756CC385AC2E DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=sourceware.org; s=default; t=1662836500; bh=fsgqy868KY4HMa1jDknytUKoeblezf/R2FZWDpq2V9s=; h=From:To:Subject:Date:From; b=n2BSIlokRV5t2OAEFLqaGyi2k2JnaxzrsF8OKxk7d61l2dM/25uADd4KN2oybW0/I suEfdwDtEgAEFQmbOJvaEKZ8dccGuic0uFQTJvzLm5B+WCez8zO8pAVZQbkC3zSWHN V/Qxuvr90g+6x5GIKZ/TjRh1NgXL4RYbmR1auwjk= Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable From: Corinna Vinschen To: newlib-cvs@sourceware.org Subject: [newlib-cygwin] upstream OpenBSD: arc4random: replace abort() with _exit() X-Act-Checkin: newlib-cygwin X-Git-Author: deraadt X-Git-Refname: refs/heads/master X-Git-Oldrev: dd22053feefe83515416a2977ec9943809c93754 X-Git-Newrev: db5e07368c10fb6c362343d94775ab0a3248d0e7 Message-Id: <20220910190140.756CC385AC2E@sourceware.org> Date: Sat, 10 Sep 2022 19:01:40 +0000 (GMT) List-Id: https://sourceware.org/git/gitweb.cgi?p=3Dnewlib-cygwin.git;h=3Ddb5e07368c1= 0fb6c362343d94775ab0a3248d0e7 commit db5e07368c10fb6c362343d94775ab0a3248d0e7 Author: deraadt Date: Sun Mar 24 17:56:54 2019 +0000 upstream OpenBSD: arc4random: replace abort() with _exit() =20 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. Diff: --- newlib/libc/stdlib/arc4random.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/newlib/libc/stdlib/arc4random.c b/newlib/libc/stdlib/arc4rando= m.c index 4f6dccd3c..8bb7a6671 100644 --- a/newlib/libc/stdlib/arc4random.c +++ b/newlib/libc/stdlib/arc4random.c @@ -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 $ */ =20 /* * Copyright (c) 1996, David Mazieres @@ -75,7 +75,7 @@ _rs_init(u_char *buf, size_t n) =20 if (rs =3D=3D NULL) { if (_rs_allocate(&rs, &rsx) =3D=3D -1) - abort(); + _exit(1); } =20 chacha_keysetup(&rsx->rs_chacha, buf, KEYSZ * 8, 0);