Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2496871rwb; Sat, 19 Nov 2022 17:50:08 -0800 (PST) X-Google-Smtp-Source: AA0mqf6SuyO8nbTKl883q0ybRV0tVuVKTYEwHcJwS1X4abxgPbQkihjv8O7VdiO2WVRMqLPrPpDo X-Received: by 2002:a17:906:2308:b0:7ad:2da5:36e1 with SMTP id l8-20020a170906230800b007ad2da536e1mr10445631eja.548.1668909007941; Sat, 19 Nov 2022 17:50:07 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668909007; cv=none; d=google.com; s=arc-20160816; b=Br2ouJOyPG70q/Qcl1iJmTowY9uAdIbZ4yBCu0gGaHYGVU2g1wr7Q4bteb4Szh/BNq Uqt3/t9yPDbsmX49RQqC//s5aAKFFLfcIm2MPKQ3cmgM2s3v1XcmLgdWehHPOsDjbCBd b3p6VK7U050fUy9IrJ2pz9Srjxs7f1nb0RL23Gpn9ixdhbJeYxGXzrPO2txsKwf3tzhf u8i0L1bvmFHk248LywDsrgAdiPiyfS9/OGyJudiK5WWPUppiCHk0kB4NGuV1UPlu53jo eoyARJg+GHy6fiLnKJTJSBo4meZE/ZtFeHYWG/3azr4usiWXt1/8WpqE/rS1uTJ4p0K2 Vxwg== 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=EMOnb4Eh0QJPg88DCqW7xV2grBHj3iQptuAg9SBqi6s=; b=LGbQTaE/z+hNpgcV+pjYLX6G/0c67nbVqh/kONALMBITdvuKCKLhkGTWT8bdnAsp6A +x2Ix6vnDdcBRfNtH1LXvQN4TP1Z6PWP11zzGRwdqwsjFBrxTyVBO1Gv3qc7+Awt3opJ EJGCGiI0xF+Vw5+JOCBeX7CyPD4pQsNrQdz+mO5iKa2grDztPCv1BxMye9rvNZtap1UI ivlLjLyF2COb6kkXyzRu+o0KQOh9tWQ0AdG+BkTeYKCfTzp+ddox3U7xkTLA9CnyAUTv AMNcMGHaQX1Y/atks9YtMhsnWdcJ8h2lzIUW6APdJb9qELX3IlYECJqcIoXAbNqaQQAC mx+A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ODdiTBv9; 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 y14-20020a056402440e00b0046382109edbsi6825745eda.395.2022.11.19.17.49.44; Sat, 19 Nov 2022 17:50:07 -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=ODdiTBv9; 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 S229499AbiKTBnk (ORCPT + 99 others); Sat, 19 Nov 2022 20:43:40 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36878 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229455AbiKTBnk (ORCPT ); Sat, 19 Nov 2022 20:43:40 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 925F3B6B26; Sat, 19 Nov 2022 17:43:39 -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 ams.source.kernel.org (Postfix) with ESMTPS id 4172AB8092C; Sun, 20 Nov 2022 01:43:38 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D83F9C433C1; Sun, 20 Nov 2022 01:43:35 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ODdiTBv9" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1668908614; 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=EMOnb4Eh0QJPg88DCqW7xV2grBHj3iQptuAg9SBqi6s=; b=ODdiTBv9ajWI3NjDRVhUjH7AMzmT55WJR8XnvwC+3FnpYhLEW6CQKy/r7IoTO6ScCzbwTG 60y4/nmZgs/2XqSyiczEoQq0qaMf1QMnaZtfHaCjRvulL7K5lfBrl2B3a00Tlm43j3EhLl 75+T1ccrLI3izYvLGZW25h+oDpnQqpM= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 58321d7a (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Sun, 20 Nov 2022 01:43:33 +0000 (UTC) Date: Sun, 20 Nov 2022 02:43:31 +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 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...) Jason