Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp2651770rwb; Wed, 30 Nov 2022 09:08:04 -0800 (PST) X-Google-Smtp-Source: AA0mqf4QJ0ypL15hW+xOF0pYezZJnzGY1ERfS0sXMZ1iwlMOl5dJPQeGKpNtIs0QBpDOMqM9D3Kn X-Received: by 2002:a17:906:658:b0:7ae:df97:9ff4 with SMTP id t24-20020a170906065800b007aedf979ff4mr3259190ejb.762.1669828084550; Wed, 30 Nov 2022 09:08:04 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669828084; cv=none; d=google.com; s=arc-20160816; b=DWz90roZj1t/Lg3mUBzk3DGHnANE0qowDWcMfPvPkVW3oPUkeNu0wI8LCO1C0e9BBc bcKB6nf62w/NA4uHN3xvbKkc533Ns4CdQa04X3657hb4P1can5JBdtrja907D7OMSY09 WoVooZ5t4HxkjqGzkbD7jcSOsc9pGdbsKLUF518OaMldDl0xnqBM2aj6wpOsSzXTd1ax 5/eVpUN1irvhfli4oSOLpFTlczYtft2RJwNc+YsoTifTBvjwr0XKbMKrQajL6o2OLX9O czorHsE3no0tXJNXN7BGJkOgGAfTzEwbuYD1Ei/D1sbbPCAOQZtFIYlozigJG64FU9on yhJw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:mime-version:message-id:date:references :in-reply-to:subject:cc:to:dkim-signature:dkim-signature:from; bh=jjMJHHMyqhLkfdRT9iuq6XDxjOMpNYWRh37e3CUD8CA=; b=Ms5rmUk4ohV6elezdw0qH8hSAFHNmJSEDdZ+mynj+Bvy7ijHHJrg8Rjo5WU8xED35p aRhmAIZEuYB8vRsrZ7Sj0jNp8zw+S+Rwx64+20hkAe+BI2poA+b3xzdFI++RUAh8aRtH PD2M1PJ/+0ZZf90RkVHrkxlt78DoaPGyRrOWhWuYW9hKu1Xm/lULLQO7l1GFz2SU6fuQ ZixPQeUQcNacwRao5EvQ6K9JGXWbCOg2FfvXMDlzIj8Q4Bm1/baEVc50YHvHCFG70F8/ rH+CxzjQ9NzZU7/2YTUbp+HR45dcZRzENNWOSA71Kp/k929ZjhDika/XHNgC8WW52E// GCrA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linutronix.de header.s=2020 header.b=myw6xp0D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="DcLE/BRR"; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id q11-20020a056402518b00b004615855c483si1825616edd.98.2022.11.30.09.07.21; Wed, 30 Nov 2022 09:08:04 -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=@linutronix.de header.s=2020 header.b=myw6xp0D; dkim=neutral (no key) header.i=@linutronix.de header.s=2020e header.b="DcLE/BRR"; 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=NONE sp=QUARANTINE dis=NONE) header.from=linutronix.de Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S231256AbiK3RFu (ORCPT + 99 others); Wed, 30 Nov 2022 12:05:50 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54334 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229839AbiK3RFL (ORCPT ); Wed, 30 Nov 2022 12:05:11 -0500 Received: from galois.linutronix.de (Galois.linutronix.de [193.142.43.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 044E993A6D; Wed, 30 Nov 2022 09:00:10 -0800 (PST) From: Thomas Gleixner DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020; t=1669827608; 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=jjMJHHMyqhLkfdRT9iuq6XDxjOMpNYWRh37e3CUD8CA=; b=myw6xp0Dnh3wwdR9mqSMUGj3QLWVHrv3/yXT7NjbHjRyxY9pUsSss8Z8aQM9P2DmDPrhaM eWMFC84xT/a0H4sxUxGZUZ6yCGiAFB2e3GLuEx91WZcQxNgk/jUYPyCEXek2Kbyz4+jrzN Wr9+ncWyqDUTrtelfTt7aay3V0OXjsIEGltNPxEtRvm4ghKJ2P+hheZ7edosjd5QsxX6lK LIy59LGxYxAS2FYQhXap3hW8STItheNzupoh3THyZGDzOXa0civJEj+W7l92jvSdiNHsVh ymyJ4T7P1Bfn4ftp8M2KogW7kNeRThl2pVhz5bFd7flBvtnt0r77x1YbEy/1ag== DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=linutronix.de; s=2020e; t=1669827608; 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=jjMJHHMyqhLkfdRT9iuq6XDxjOMpNYWRh37e3CUD8CA=; b=DcLE/BRRpt3HcZ/qS1N/9ABGBGH7ajSS8N2HyEb/sZFissGqPJYdutBNvp1kCdXlBIYuWK +ohCGzV0qQNKpgCA== To: "Jason A. Donenfeld" , Arnd Bergmann Cc: Florian Weimer , linux-kernel@vger.kernel.org, patches@lists.linux.dev, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, x86@kernel.org, Greg Kroah-Hartman , Adhemerval Zanella Netto , Carlos O'Donell , Christian Brauner Subject: Re: [PATCH v10 3/4] random: introduce generic vDSO getrandom() implementation In-Reply-To: References: <20221129210639.42233-1-Jason@zx2c4.com> <20221129210639.42233-4-Jason@zx2c4.com> <878rjs7mcx.fsf@oldenburg.str.redhat.com> <16ec2a7a-c469-4732-aeca-e74a9fb88d3e@app.fastmail.com> <574ad32d-566e-4c18-a645-1470fc081ede@app.fastmail.com> Date: Wed, 30 Nov 2022 18:00:07 +0100 Message-ID: <8735a0tm20.ffs@tglx> MIME-Version: 1.0 Content-Type: text/plain X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,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 Wed, Nov 30 2022 at 16:47, Jason A. Donenfeld wrote: > On Wed, Nov 30, 2022 at 4:29 PM Arnd Bergmann wrote: >> I see what you mean now. However this means your vdso32 copies >> are different between 32-bit and 64-bit kernels. If you need to >> access one of the fields from assembler, it even ends up >> different at source level, which adds a bit of complexity. >> >> Making the interface configuration-independent makes it obvious >> to the reader that none of these problems can happen. > > Except ideally, these are word-sized accesses (where only compat code > has to suffer I suppose). While I hate it with a passion, there is actually a valid reason to use this ugly typedef. On 32bit architectures which have load/store tearing of 64bit variables into two 32bit accesses due to ISA limitations, that results in undefined behaviour when write and read are concurrent. Neither READ_ONCE() nor WRITE_ONCE help there. Though that begs the question whether we need a 64bit generation counter for the VDSO at all. Thanks, tglx