Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp874782imn; Tue, 26 Jul 2022 11:43:07 -0700 (PDT) X-Google-Smtp-Source: AGRyM1twSXqs30dT9EgzTbm73bWj7RQIe6x5FccyN6aQ6N52smk1hggwHAXC1VIMXH5hhQODKWjJ X-Received: by 2002:a17:906:fc6:b0:72f:d080:416 with SMTP id c6-20020a1709060fc600b0072fd0800416mr10501666ejk.1.1658860986811; Tue, 26 Jul 2022 11:43:06 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658860986; cv=none; d=google.com; s=arc-20160816; b=Qv8FNhxw8ls+Fgbgdy8YFHpLuEwIjXPg/YPpUg23BkryJi0M2Mlsxlzl2Fp2SfcAia xh90fyZP0xoW5EFzfnXhczbAMFet06G0WRyDJsTDOBLnUwU92zV1ijIMSr7jn9438OQB a8GqbhcPzzjw1weD+DHj5LDnPJc9X19zQBXwfeOKnmvMxPINjccwtOP5cl5DLkbP0hPJ vwOFFkibVmmrbS2v1ORjkNwr8XMMReNSPUhxmqJIMcAT9SeL7S+afE6L1AZd/7E0XSS1 FfhTKope8x8Ux8Oj3G5Fus1iqCl2j2yW75OigZrRgl7TzzUr/7WetBvu9LLGO5pAtsr4 M/Aw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=KBtVCb+gs9V9oJDCZh/m2Gv64lXqzBv+HHF42prGwN8=; b=jNC21l6QiZoHUFcJsZCfRw/EDYtEMWRtsgPQd2thws1z5UEkN1E1VSNNKULkzjymGg voz7yiRhqI04v0Fo6xY36DIJwpeQj8fqZbvQkP+VWAsbm4Xi6EoBhSNF5CnELgWuTAW1 88AVr5Elzrxd1GV0gr+ZpIXhsvExDnpX8GQ7Gx9usgigylYZ65gbaO4w3yFCnvSbo+t8 omVRNKZAGpS/KUKbC7fjlltUFykeaQ1NPXCMFm+LG13K0f59YSVZbPHuJUXnn1rfEVph Dv0Acl3cx8eyqR3mcSQWNUtYsjJh4lJF5DjLaATIzBaEUbdSyxXNjODzs0mHc2awk5l9 m+iQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=f7jDlF7X; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id c20-20020a05640227d400b0043c25d25046si5196991ede.249.2022.07.26.11.42.27; Tue, 26 Jul 2022 11:43:06 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=f7jDlF7X; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S230351AbiGZSg6 (ORCPT + 99 others); Tue, 26 Jul 2022 14:36:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52564 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S239601AbiGZSg4 (ORCPT ); Tue, 26 Jul 2022 14:36:56 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1EEFA32EFD for ; Tue, 26 Jul 2022 11:36:54 -0700 (PDT) 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 sin.source.kernel.org (Postfix) with ESMTPS id 7DCC2CE1A92 for ; Tue, 26 Jul 2022 18:36:52 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1792AC433D6; Tue, 26 Jul 2022 18:36:49 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="f7jDlF7X" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1658860608; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=KBtVCb+gs9V9oJDCZh/m2Gv64lXqzBv+HHF42prGwN8=; b=f7jDlF7X5qjCbmjWAT0o4y1rAr0xR9hp82YFF/nFc/1+8t3ZhkbAehcm7kbQsoyZY0T1Hf MJQHKAOn9V5F7HeZ7HRrVHR8HjTEhbsOCrrpkMMXuFhaCdvUTQTpHijr79MjbaUqirEkQ3 2JI+GTk2kSYKIc1fumPHC2Jv0J1CSyQ= X-Spam: yes X-Spam-Score: 9 / 20 X-Spam-Status: No, score=-5.1 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS,URIBL_BLACK autolearn=ham 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 lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org 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