From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by sourceware.org (Postfix) with ESMTPS id B55723858430 for ; Tue, 26 Jul 2022 12:08:53 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org B55723858430 Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id 5F98D614D5; Tue, 26 Jul 2022 12:08:53 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 0F81EC341C0; Tue, 26 Jul 2022 12:08:51 +0000 (UTC) Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 3ad2ae25 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 26 Jul 2022 12:08:50 +0000 (UTC) Date: Tue, 26 Jul 2022 14:08:48 +0200 From: "Jason A. Donenfeld" To: Adhemerval Zanella Netto Cc: libc-alpha@sourceware.org, Florian Weimer , Cristian =?utf-8?Q?Rodr=C3=ADguez?= , Paul Eggert , linux-crypto@vger.kernel.org Subject: Re: [PATCH v2] arc4random: simplify design for better safety Message-ID: References: <20220725225728.824128-1-Jason@zx2c4.com> <20220725232810.843433-1-Jason@zx2c4.com> <9c576e6b-77c9-88c5-50a3-a43665ea5e93@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-2.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE, SPF_PASS, TXREP autolearn=no 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: Tue, 26 Jul 2022 12:08:55 -0000 Hey again, On Tue, Jul 26, 2022 at 01:54:23PM +0200, Jason A. Donenfeld wrote: > > As Florian said we will need a non cancellable poll here. Since you are setting > > the timeout as undefined, I think it would be simple to just add a non cancellable > > wrapper as: > > > > int __ppoll_noncancel_notimeout (struct pollfd *fds, nfds_t nfds) > > { > > #ifndef __NR_ppoll_time64 > > # define __NR_ppoll_time64 __NR_ppoll > > #endif > > return INLINE_SYSCALL_CALL (__NR_ppoll_time64, fds, nfds, NULL, NULL, 0); > > } > > > > So we don't need to handle the timeout for 64-bit time_t wrappers. > > Oh that sounds like a good solution to the time64 situation. I'll do > that for v4... BUT, I already implemented possibly the wrong solution > for v3. Could you take a look at what I did there and confirm that it's > wrong? If so, then I'll do exactly what you suggested here. Actually, forget my v3. What you're suggesting is also better because it's ppoll, not poll, as poll isn't on all platforms. So I'll do things exactly as you've described for v4. Jason