From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by sourceware.org (Postfix) with ESMTPS id CFDA63858D32 for ; Tue, 26 Jul 2022 18:36:51 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org CFDA63858D32 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 283B4614CC; Tue, 26 Jul 2022 18:36:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1792AC433D6; Tue, 26 Jul 2022 18:36:49 +0000 (UTC) X-Spam: yes X-Spam-Score: 9 / 20 X-Spam-Status: No, score=-2.1 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, SPF_HELO_NONE, SPF_PASS, TXREP, URIBL_BLACK autolearn=no autolearn_force=no version=3.4.6 Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id d9be2f07 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Tue, 26 Jul 2022 18:36:47 +0000 (UTC) Date: Tue, 26 Jul 2022 20:36:45 +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 , Mark Harris , Eric Biggers , linux-crypto@vger.kernel.org Subject: Re: [PATCH v4] arc4random: simplify design for better safety Message-ID: References: <20220725225728.824128-1-Jason@zx2c4.com> <20220726133049.1145913-1-Jason@zx2c4.com> <45ef8ca0-12ca-4853-98a0-9f52dfca8c57@linaro.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: <45ef8ca0-12ca-4853-98a0-9f52dfca8c57@linaro.org> 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 18:36:56 -0000 Hi Adhemerval, On Tue, Jul 26, 2022 at 01:20:11PM -0300, Adhemerval Zanella Netto wrote: > > + { > > + atomic_store_relaxed (&have_getrandom, false); > > I still think there is no much gain in this optimization, the syscall will > most likely be present and it is one less static data. Also, we avoid to > use __ASSUME_GETRANDOM on generic code (all __ASSUME usage within > sysdeps and/or nptl). Oh! *That's* what you were talking about before. Sorry I didn't catch your meaning the first time through. Okay so you're alright having +1 syscall overhead on old systems, so that new systems can have a byte less of static data. I don't hold any opinions either way there and will defer to your expertise, so I'll get rid of this part on v5. > > + __ppoll_infinity_nocancel; > > __sigtimedwait; > > # functions used by nscd > > __netlink_assert_response; > > There is no need to export on GLIBC_PRIVATE, since it is not currently usage > libc.so. Just define is a hidden (attribute_hidden). > Use attribute_hidden here and remove it from sysdeps/unix/sysv/linux/Versions. >> Maybe just add an inline wrapper on sysdeps/unix/sysv/linux/not-cancel.h, > as for __getrandom_nocancel: > It avoids a lot of boilerplate code to add the internal symbol. Okay I'll skip all the symbol stuff and just do the static inline like getrandom has. Thanks for the suggestion; that's a lot simpler. > Also update the hurd sysdeps/mach/hurd/not-cancel.h with a wrapper to > __poll (since it does not really support pthread cancellation). Ack. Thanks for the comments. v5 coming up shortly. Jason