From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from zimbra.cs.ucla.edu (zimbra.cs.ucla.edu [131.179.128.68]) by sourceware.org (Postfix) with ESMTPS id DF74A3858C27 for ; Sat, 23 Jul 2022 17:18:07 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org DF74A3858C27 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=cs.ucla.edu Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=cs.ucla.edu Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 0A0401600FC; Sat, 23 Jul 2022 10:18:07 -0700 (PDT) Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10032) with ESMTP id SKq9l6W-0LJj; Sat, 23 Jul 2022 10:18:06 -0700 (PDT) Received: from localhost (localhost [127.0.0.1]) by zimbra.cs.ucla.edu (Postfix) with ESMTP id 3F12A1600FD; Sat, 23 Jul 2022 10:18:06 -0700 (PDT) X-Virus-Scanned: amavisd-new at zimbra.cs.ucla.edu Received: from zimbra.cs.ucla.edu ([127.0.0.1]) by localhost (zimbra.cs.ucla.edu [127.0.0.1]) (amavisd-new, port 10026) with ESMTP id yTW-rWOh7b3d; Sat, 23 Jul 2022 10:18:06 -0700 (PDT) Received: from [192.168.1.9] (cpe-172-91-119-151.socal.res.rr.com [172.91.119.151]) by zimbra.cs.ucla.edu (Postfix) with ESMTPSA id 167EF1600FC; Sat, 23 Jul 2022 10:18:06 -0700 (PDT) Message-ID: <555f2208-6a04-8c3c-ea52-41ad02b33b0c@cs.ucla.edu> Date: Sat, 23 Jul 2022 10:18:05 -0700 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Thunderbird/91.11.0 Content-Language: en-US To: "Jason A. Donenfeld" References: From: Paul Eggert Organization: UCLA Computer Science Department Cc: libc-alpha@sourceware.org Subject: Re: arc4random - are you sure we want these? In-Reply-To: Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Spam-Status: No, score=-3.3 required=5.0 tests=BAYES_00, KAM_DMARC_STATUS, NICE_REPLY_A, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on server2.sourceware.org X-BeenThere: libc-alpha@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libc-alpha mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Sat, 23 Jul 2022 17:18:09 -0000 On 7/23/22 09:25, Jason A. Donenfeld via Libc-alpha wrote: > it's hard to recommend that anybody really use these functions. > Just keep using getrandom(2), which has mostly favorable semantics. Yes, that's what I plan to do in GNU projects like Coreutils and Emacs. Although I don't recommend arc4random, I suppose it was added for source-code compatibility with the BSDs (I wasn't involved in the decision). > is there anyway that glibc can *not* do this, or has that > ship fully sailed It hasn't fully sailed since we haven't done a release. > it's fun to make a random number generator, and so lots > of projects figure out some way to make yet another one somewhere > somehow. That's a bit harsh. Coreutils still has its own random number generator because it needed to be portable to a bunch of platforms and there was no standard. Eventually we'll rip it out but there's no rush. Having written much of that code I can reliably assert that it was not fun.