Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp3668794rwb; Sun, 20 Nov 2022 19:31:00 -0800 (PST) X-Google-Smtp-Source: AA0mqf49keFjxNhVGZJx5uHr2WSYQximWIxQ6Gpxn4+9ci1bFOOdJ2sKd4hmyjdheJFtBpC4V6vy X-Received: by 2002:a63:d249:0:b0:43c:ac7c:ee27 with SMTP id t9-20020a63d249000000b0043cac7cee27mr6331390pgi.583.1669001460227; Sun, 20 Nov 2022 19:31:00 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669001460; cv=none; d=google.com; s=arc-20160816; b=idAq+49OBeu1JyrcDDstR7lnesJ7M0NNf65PdkfskZqJW6qJMOoFKmC36O0La+2Dwk fq+y7wLvO/QDR/DvSvwLb0QcHg6kcO/0DeLnGm9nynkqRs0ZYJPSA03NFnYyRipi7HGM UE1VNkZ5aO0gE5CzF1H//ebLpmi0gEmxZXgsdj1hMRDhTEYeok/BUL6cJkFB0/gDmlv8 GdqiJbIH7FtT9sfiCC8JPR2QwZnJC6YyYeohEMaye4cB5MUo+m5NzxnIxpzq/rjDq4Ru xuKRdgJ4eMjePhbfFBwB6qLlYyNMdMWsCveUzVTxACRYJrKHY7rx4USnQA8QHF0ownko jE6Q== 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=DAa5Mzb5unqukMrdaJuHIYWbZgREOXZOVUCauEOi2ps=; b=HXMbulLrJpMoYPOQETanw3eWsvZHWcQsCpRL+F+G52wz1KQdbLgfE3HHXXhtSIxDiD dicq2DuxDG5G4RVUh8DaGgyADNfwVm5ZzeSd3O4lGcpXab1bJhaOlcMNY9qSx67lqkdI Tf4ucdG+7blWFsyWgkicrn1vsKyOpbJq/cSAAZb0oYMDI+YwLESXZEwtgejYyiUqloKY xeJRtlYwuAM3HzcoS1pCNLoRB0VeGZ6Gu175DXvpYWr8m369ojCzfsV4b/vVYPhZyAi4 QON7nTlQtAt6K7q/U2e56/doH7Pv9FKjH0ccdHPmGNT2vz+Wbc1OhohHZkX+3F4juWYP /36g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="UTJ7/TuL"; 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 w23-20020a1709029a9700b001892277e107si1382429plp.64.2022.11.20.19.30.38; Sun, 20 Nov 2022 19:31:00 -0800 (PST) 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="UTJ7/TuL"; 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 S229760AbiKUDXD (ORCPT + 99 others); Sun, 20 Nov 2022 22:23:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:60944 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229498AbiKUDXC (ORCPT ); Sun, 20 Nov 2022 22:23:02 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D5B1D1409D; Sun, 20 Nov 2022 19:23:01 -0800 (PST) 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 684D760E9E; Mon, 21 Nov 2022 03:23:01 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 8DD15C433D6; Mon, 21 Nov 2022 03:22:59 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="UTJ7/TuL" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1669000977; 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=DAa5Mzb5unqukMrdaJuHIYWbZgREOXZOVUCauEOi2ps=; b=UTJ7/TuLDD1B+OoUcpwgmLVZFvlUFpMC4gBltI6OxPZ78kzxh84N1P6i4IgYHl0PE4sSYD jPUX0NYXAF5uitLAOsAzthyR438A8ATpqZtkPg6Tk1STEcMJzJSDJWZINZsSPjfmWncLIn stONI7x5GrBtA2+CGCWBLk6Dnh4vnvo= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id ca013759 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Mon, 21 Nov 2022 03:22:57 +0000 (UTC) Date: Mon, 21 Nov 2022 04:22:54 +0100 From: "Jason A. Donenfeld" To: Eric Biggers Cc: linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-crypto@vger.kernel.org, x86@kernel.org, Thomas Gleixner , Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell Subject: Re: [PATCH v5 2/3] random: introduce generic vDSO getrandom() implementation Message-ID: References: <20221119120929.2963813-1-Jason@zx2c4.com> <20221119120929.2963813-3-Jason@zx2c4.com> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-6.8 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 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 On Sun, Nov 20, 2022 at 02:43:31AM +0100, Jason A. Donenfeld wrote: > On Sun, Nov 20, 2022 at 01:53:53AM +0100, Jason A. Donenfeld wrote: > > shouldn't fork or something, but that seems disappointing. Or more state > > could be allocated in the zeroing region, to hold a chacha state, so > > another 64 bytes, which would be sort of unfortunate. Or something else? > > I'd be interested to hear your impression of this quandary. > > Another 128 bytes, actually. And the current chacha in there isn't > cleaning up its stack as one might hope. So maybe the cleanest solution > would be to just bite the bullet and allocate another 128 bytes per > state and make a mini chacha that operates over that? (And I guess hope > it doesn't need to spill and such...) I've got it implemented without using any stack now. Wasn't so bad. So all of the additional concerns I added will be addressed in v+1. Jason