Received: by 2002:ac0:e34a:0:0:0:0:0 with SMTP id g10csp139562imn; Wed, 27 Jul 2022 17:56:14 -0700 (PDT) X-Google-Smtp-Source: AGRyM1tOhe2Pi6XGCNyDuk0oxcuiiIznViQOpeuwjNhaJIrOIhkJPwAhIrN6xTC0TAn5iVov6oX8 X-Received: by 2002:a05:6402:1f13:b0:43b:c521:8de7 with SMTP id b19-20020a0564021f1300b0043bc5218de7mr24766278edb.79.1658969774533; Wed, 27 Jul 2022 17:56:14 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1658969774; cv=none; d=google.com; s=arc-20160816; b=R3zKd5dATgql88OxmwCs/KLyRSQ3bI3qeWBgCV6oqG49azRuiQLkBE2rY9qbgc3bqZ OPk+9wMxe/SKClPc28yQvJ25CJQ7STmnEcwozTFhMNnAAqu58taQRXTsF0g26SF99gs0 y7EFiMMVmeBTRSsobj2JCGqGNIFOjUv8hqj6xWp1KlxlV8EmVGFw+mlx/55t3/7HWzuJ 44UCnN1u7h/KraYOYnVxrPL2MXeoYqIMtKJGXu1EsHNHD+o50JMcxACYBZhBDmPmeh0v vwsQp6cHq1cmJhHTMUe6NL04/2xgF22kHpbfGuLb2r9cJYZRdgfwCTEQoyLVtI8BgOMa PMaA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version; bh=00VtRx17FOWjYwT1CKqFIGQhFvsSjII65T55g6qnIDU=; b=gQwJQW64bNsvr+V5frHW78QMgTUAaaDSCmH6K1tZfrLJlnNiNhQu+chzJRO9dBQgEL ee1bgvViwYEbpdnxjSKlmgvRNJoGD0I3DfUSbEVnzsbpy4tIWED25QC8DH43BwPjPcJv YTzayRFVnXb44VYOcOKa6HULGnCXYgMDM+Tsi5RlX7HN7UeHTSaRzFebz+Uq8fQG8ig6 HkqQDIzYsweKkuMPSRcM+Cs9RKqHumRbxkesSVJu32yNjIMxAEBvh60XZJyjHSd4Lj4V +/IXBBS2CqOKVEzsBrcj/ulx8K+NPfPNBxgkOYmg8q2R3jLQQcmVJamFzh/HVqmcwKaj 438A== ARC-Authentication-Results: i=1; mx.google.com; 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=fail (p=NONE sp=NONE dis=NONE) header.from=opensuse.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa44-20020a17090786ac00b007267675e19csi6028948ejc.691.2022.07.27.17.55.25; Wed, 27 Jul 2022 17:56:14 -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; 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=fail (p=NONE sp=NONE dis=NONE) header.from=opensuse.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229505AbiG1AkR (ORCPT + 99 others); Wed, 27 Jul 2022 20:40:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229898AbiG1AkP (ORCPT ); Wed, 27 Jul 2022 20:40:15 -0400 Received: from mail-wr1-f48.google.com (mail-wr1-f48.google.com [209.85.221.48]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D302965F1 for ; Wed, 27 Jul 2022 17:40:12 -0700 (PDT) Received: by mail-wr1-f48.google.com with SMTP id v17so255100wrr.10 for ; Wed, 27 Jul 2022 17:40:12 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=00VtRx17FOWjYwT1CKqFIGQhFvsSjII65T55g6qnIDU=; b=pZo7XWKwNPxrkrJ8XmFbaKRmlx3MMapCU2D6icaVgZpApaoD8FcNSTQmwiKtm4Knp0 dfAcNrOIsN8ZOs4HZzi1s3XElNXFO93bGucPRRBFehOqrBkgFW4Y9ASYzHec2+Q68WDg CmLdyRL1KLFz2ivtNCYhIxxc84JmZmx+jiCOuRs9PkLpH9wyBUYwuNfNfuaEIf8ph5n6 dSIobf/Qakt74ute/4MIAYQFmw6OJ3wz3SVX1Aq61LbtHffB0zPpgO51O+Y/51yJWgfQ QuBWF7lnz7YtKKbxmGTwQc+aaloPfajKkT1R58y3HfDE0OwM2e7A0Gah47vDDAC0vn/S D0+A== X-Gm-Message-State: AJIora8dcI03wqh+JmbXWDKhsNfhyBpZe/UjMqOdUbRqsmqyXDUzK6LD j6XR4SeeMjpKqlf+4CdgkHhUE9gqy92w67F43ivN2A== X-Received: by 2002:a5d:65cd:0:b0:21e:6e3b:b1a8 with SMTP id e13-20020a5d65cd000000b0021e6e3bb1a8mr14586353wrw.470.1658968811242; Wed, 27 Jul 2022 17:40:11 -0700 (PDT) MIME-Version: 1.0 References: <6bf352e9-1312-40de-4733-3219721b343c@linaro.org> <20220725153303.GF7074@brightrain.aerifal.cx> <878rohp2ll.fsf@oldenburg.str.redhat.com> <20220725174430.GI7074@brightrain.aerifal.cx> <20220725184929.GJ7074@brightrain.aerifal.cx> <87v8rid8ju.fsf@oldenburg.str.redhat.com> In-Reply-To: From: =?UTF-8?Q?Cristian_Rodr=C3=ADguez?= Date: Wed, 27 Jul 2022 20:39:59 -0400 Message-ID: Subject: Re: arc4random - are you sure we want these? To: "Theodore Ts'o" Cc: Florian Weimer , Yann Droneaud , "Jason A. Donenfeld" , Rich Felker , libc-alpha@sourceware.org, Michael@phoronix.com, linux-crypto@vger.kernel.org, jann@thejh.net Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-1.7 required=5.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 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 On Wed, Jul 27, 2022 at 4:15 PM Theodore Ts'o via Libc-alpha wrote: > > On Wed, Jul 27, 2022 at 02:49:57PM +0200, Florian Weimer wrote: > > * Theodore Ts'o: > > > > > But even if you didn't take the latest kernels, I think you will find > > > that if you actually benchmark how many queries per second a real-life > > > secure web server or VPN gateway, even the original 5.15.0 /dev/random > > > driver was plenty fast enough for real world cryptographic use cases. > > > > The idea is to that arc4random() is suitable in pretty much all places > > that have historically used random() (outside of deterministic > > simulations). Straight calls to getrandom are much, much slower than > > random(), and it's not even the system call overhead. > > What are those places? Well pretty much everywhere a shared library is involved from the start.. On one very basic vm here there are 18 shared libraries using srandom, thus perturbing each other states if loaded by the same process, possibly in a catastrophic/predictable way. and nobody uses the random_r interfaces. > And what are their performance and security > requirements? Common programmers know nothing about this, even seasoned ones don't.. if it runs slow or is not CSPRNG then the average app will use one userspace PRNG or CSPRNG or buffer from the kernel somewhere.. I do not have to justify this assertion..it is just a matter you download libgcrypt, gnutls, openssl none of those libraries use the kernel entropy as the first option, all feed them to either proven or dubious s RNGs schemes and then pass that to users. Think on why that is and why we are discussing yet another interface in the first place..