Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp2190805iog; Sun, 19 Jun 2022 09:56:50 -0700 (PDT) X-Google-Smtp-Source: AGRyM1uwd9k8SARRAE77NUIRKzX8W22xSHTnQEfiIGgq73ZSGpPacWRnn7VtvL9b7zWiR3Yy2ToF X-Received: by 2002:a17:906:2298:b0:715:7f3d:32ec with SMTP id p24-20020a170906229800b007157f3d32ecmr17080039eja.538.1655657810014; Sun, 19 Jun 2022 09:56:50 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655657810; cv=none; d=google.com; s=arc-20160816; b=S2ZzAqyrwqM+awmhF4TnJTxiG7kgA8eEu76wY7Mx+Poe2sJh1bokw/vA7SLttFS9fS BqJM/S+2/qPE1ylXald8M/mlOsVXUVdiC63NRss3/+OJqV8JTDfe4OvsyhtSFriCl79i cWzrsv2+0Yl2+jTkWjPSNrdsucnxPXQntQdCp07kyifLTxsAyUKTVbGSFo7TdVIoxrh4 YcfGS75bII1MiPaa+p2USDP7BMD2uoopysEph8o8+6pNnEtZ8Y0UokyKVSVLmBuPumwT PJorNE3P8FvaYx3uXAeafwc5sDzaCIvEcgmRUOd8TVGlj3f+oC19VKuYxRzhCCmaIID2 er5A== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:user-agent:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GRLu6iVJSqKrFFq0719QBycisOdo6/QRXM7hkbw9MA8=; b=HPZ/GwoQbGCe+72GI3er2my4PauLDIKkIWjZ28SBGwDRqYHhBucpaIJdgguvfFjlNz 08ilgstmhRvfI9Dg9lBWM8iRr3E+GLap1i07ISbb3Pj+mLnoKt9WI1CTlc8QZZiqMIrn cN4thiOYSh9CPoWjISq1cUlpYwBHPjyN008q2nmS/krO/yIB/Bq0vw0mcBbmA4PIFWIN yHHa4FyOH1eVBeMtI7h2Uj4Le3wHf2wU0Di2TCXdW8ZmlLvc0SH2uFka3f4TJ2f/hgXk KXrZCGDP0QQcYNXClvchTVQBMFMfZejji3xRGJmNvW/CsNC9/L3lrHRlziEZOCqj15mP W3AA== 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 Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gu12-20020a170906f28c00b00718cc500515si8530186ejb.603.2022.06.19.09.56.23; Sun, 19 Jun 2022 09:56:49 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S234253AbiFSQ4W (ORCPT + 99 others); Sun, 19 Jun 2022 12:56:22 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41262 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232771AbiFSQ4W (ORCPT ); Sun, 19 Jun 2022 12:56:22 -0400 Received: from jabberwock.ucw.cz (jabberwock.ucw.cz [46.255.230.98]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 968D29594; Sun, 19 Jun 2022 09:56:20 -0700 (PDT) Received: by jabberwock.ucw.cz (Postfix, from userid 1017) id 4046D1C0B8F; Sun, 19 Jun 2022 18:56:19 +0200 (CEST) Date: Sun, 19 Jun 2022 18:56:15 +0200 From: Pavel Machek To: "Jason A. Donenfeld" Cc: Eric Biggers , linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Linus Torvalds , Guenter Roeck , Dominik Brodowski , Theodore Ts'o , Jann Horn Subject: Re: [PATCH] random: allow writes to /dev/urandom to influence fast init Message-ID: <20220619165615.GB3362@bug> References: <20220322191436.110963-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.23 (2014-03-12) X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_NONE, SPF_NONE,T_SCC_BODY_TEXT_LINE autolearn=ham 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 Hi! > > On Tue, Mar 22, 2022 at 01:14:36PM -0600, Jason A. Donenfeld wrote: > >> For as far back as I can tell, writing to /dev/urandom or /dev/random > >> will put entropy into the pool, but won't immediately use it, and won't > >> credit it either. > > > > Did you check kernels v4.7 and earlier? It looks like this actually changed > > in > > v4.8 when the ChaCha20 CRNG was introduced. v4.7 would mix the data written > > to > > /dev/{u,}random into {non,}blocking_pool, which would immediately be > > reflected > > in reads from /dev/{u,}random, sys_getrandom(), and get_random_bytes(). > > Writes > > to /dev/{u,}random didn't affect the input_pool, which was separate. > > Oh, I suppose you might be right, actually, that v4.7 and below would > hash the non blocking pool, and let /dev/urandom write directly into > it, as something distinct from the input pool. This changed with v4.8, > 6 years ago, and now there are no LTS kernels that old, with most > small devices even having vendor kernels v4.9+. v4.8 apparently did We are still maintaining 4.4 for -cip project, and people running android probably still maintain that, too. > this while fixing a more extreme vulnerability of allowing unprivileged users to > bruteforce input bytes (in addition to allowing unbounded unprivileged lock contention). I assume this got fixed during the 4.4-stable series? Best regards, Pavel -- (english) http://www.livejournal.com/~pavelmachek (cesky, pictures) http://atrey.karlin.mff.cuni.cz/~pavel/picture/horses/blog.html