From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (qmail 36232 invoked by alias); 10 Jun 2016 22:00:39 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 36219 invoked by uid 89); 10 Jun 2016 22:00:38 -0000 Authentication-Results: sourceware.org; auth=none X-Virus-Found: No X-Spam-SWARE-Status: No, score=-2.8 required=5.0 tests=AWL,BAYES_00,RP_MATCHES_RCVD,SPF_PASS autolearn=ham version=3.3.2 spammy= X-HELO: zimbra.cs.ucla.edu Subject: Re: [PATCH] Add getrandom implementation [BZ #17252] To: Joseph Myers , Florian Weimer References: <20160610210303.6CE3E40141175@oldenburg.str.redhat.com> Cc: libc-alpha@sourceware.org From: Paul Eggert Message-ID: Date: Fri, 10 Jun 2016 22:00:00 -0000 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.1.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-SW-Source: 2016-06/txt/msg00407.txt.bz2 On 06/10/2016 02:30 PM, Joseph Myers wrote: > Are we sure we want to keep file descriptors open that the application > can't use? Is it not valid for applications to close all open file > descriptors Yes, it's valid. How about if we use a simpler implementation instead, one that opens, reads, and closes /dev/whatever each time getrandom is called? That would be a bit slower slower but would avoid this problem and probably other problems. Performance should not the overriding goal here, as anybody who wants lots of random numbers efficiently shouldn't be using getrandom, regardless of whether it is a syscall.