public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
From: Corinna Vinschen <corinna@sourceware.org>
To: newlib-cvs@sourceware.org
Subject: [newlib-cygwin] upstream OpenBSD: arc4random: replace abort() with _exit()
Date: Sat, 10 Sep 2022 19:01:40 +0000 (GMT)	[thread overview]
Message-ID: <20220910190140.756CC385AC2E@sourceware.org> (raw)

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=db5e07368c10fb6c362343d94775ab0a3248d0e7

commit db5e07368c10fb6c362343d94775ab0a3248d0e7
Author: deraadt <deraadt@openbsd.org>
Date:   Sun Mar 24 17:56:54 2019 +0000

    upstream OpenBSD: arc4random: replace abort() with _exit()
    
    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/arc4random.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 $	*/
 
 /*
  * Copyright (c) 1996, David Mazieres <dm@uun.org>
@@ -75,7 +75,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, 0);

                 reply	other threads:[~2022-09-10 19:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220910190140.756CC385AC2E@sourceware.org \
    --to=corinna@sourceware.org \
    --cc=newlib-cvs@sourceware.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).