Received: by 2002:a05:6358:a55:b0:ec:fcf4:3ecf with SMTP id 21csp828707rwb; Thu, 12 Jan 2023 12:56:55 -0800 (PST) X-Google-Smtp-Source: AMrXdXuoudHTt/5G2pkK0KAJ7xFUUASpjiqw3seBid+8LiE2ILC0bVYcmgfMDW+zMuM07TVrACZY X-Received: by 2002:a17:906:cc4f:b0:84d:12cc:8c19 with SMTP id mm15-20020a170906cc4f00b0084d12cc8c19mr23963237ejb.45.1673557015318; Thu, 12 Jan 2023 12:56:55 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1673557015; cv=none; d=google.com; s=arc-20160816; b=FVUo46bV8C5PFr/o9p1JdsYBBn83U3R2Tp33DC6a/zq0R03VKGU5CvJbkQ6YniCBdy s03WOEUT1rZMQoIr62LF9gdsRSyA4490BU9KIzBflGkf/Jsh0Jq/C0Cefbl+rl97RmH2 K0uNyzLAwuoEI4KkB2ziPjgdwKtXmifCkl7+npwG8kBf3x3i/0denk0eQT6gt1agwkyB 9RU6XdPlLORoilwYFKT7czdKScVVeYUnUuKhek6taipkuWAKa7MrJvCG5LGbCiotq8aQ h+NStHvXnw4AnKgqUIBRy0hvMaWoXyaS8Ag+v23cDF7WNeO1cHEVRz8pZOf8/LlGsOCd 1cZw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:references:in-reply-to:cc:to:subject:message-id :from:content-transfer-encoding:date:mime-version; bh=ohKbJFTFlbQrS8nJeazN56BEzASHEUHb4hCHoB8sClE=; b=dM+V6W98+F6O4QchpAmJ0hhj4w0uPtVhjuIB/8AvotniflRKh4T9mYOiE+AX+H6cKF iiRmtQL8f1tD1Tevs/4HyF3brpra079CLcDZxdzqnhfw2BJU7b1AI9oHUrqwrt8MLcgy Zo7v0gD+aE1vrE2fE15/Ryaf1nqaZIvWn7vcxUh4UrvQnuB85olzBmc6XCmX4baYnSR1 Ry5pxLjGm3eybafJf05hi/lnoGIpHjH6hMOCS/l9AWyKWCsuMr1+laBSmtNZkTupXYOq Wn7VxwIrPo+p+z2id/dE78cfOH+EhGz+44AkeXF29uVa/1y28mrh9V4qFZ2RDkasrZiq PKOg== 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 p20-20020a1709060dd400b007c17665c404si14003890eji.960.2023.01.12.12.56.25; Thu, 12 Jan 2023 12:56:55 -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; 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 S240569AbjALUyp convert rfc822-to-8bit (ORCPT + 99 others); Thu, 12 Jan 2023 15:54:45 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53278 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240473AbjALUx2 (ORCPT ); Thu, 12 Jan 2023 15:53:28 -0500 X-Greylist: delayed 1200 seconds by postgrey-1.37 at lindbergh.monkeyblade.net; Thu, 12 Jan 2023 12:31:17 PST Received: from ouvsmtp1.octopuce.fr (ouvsmtp1.octopuce.fr [194.36.166.50]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 30F7013F46; Thu, 12 Jan 2023 12:31:17 -0800 (PST) Received: from panel.vitry.ouvaton.coop (unknown [194.36.166.20]) by ouvsmtp1.octopuce.fr (Postfix) with ESMTPS id 863D21DC; Thu, 12 Jan 2023 20:55:34 +0100 (CET) Received: from sm.ouvaton.coop (ouvadm.octopuce.fr [194.36.166.2]) by panel.vitry.ouvaton.coop (Postfix) with ESMTPSA id 42E285E1B7F; Thu, 12 Jan 2023 20:55:34 +0100 (CET) MIME-Version: 1.0 Date: Thu, 12 Jan 2023 19:55:34 +0000 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8BIT From: "Yann Droneaud" Message-ID: Subject: Re: [RFC PATCH 0/4] random: a simple vDSO mechanism for reseeding userspace CSPRNGs To: "Jason A. Donenfeld" Cc: "Theodore Ts'o" , "Thomas Gleixner" , "Ingo Molnar" , "Borislav Petkov" , "Dave Hansen" , "H. Peter Anvin" , "Andy Lutomirski" , "Vincenzo Frascino" , x86@kernel.org, linux-crypto@vger.kernel.org, linux-api@vger.kernel.org, linux-kernel@vger.kernel.org, "Florian Weimer" , "Adhemerval Zanella Netto" , "Carlos O'Donell" In-Reply-To: References: X-Originating-IP: 10.0.20.16 X-Spam-Status: No, score=-1.9 required=5.0 tests=BAYES_00,SPF_HELO_PASS, SPF_PASS autolearn=unavailable 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 12 janvier 2023 à 18:07 "Jason A. Donenfeld" a écrit: > Sorry Yann, but I'm not interested in this approach, and I don't think > reviewing the details of it are a good allocation of time. I don't > want to lock the kernel into having specific reseeding semantics that > are a contract with userspace, which is what this approach does. This patch adds a mean for the kernel to tell userspace: between the last time you call us with getrandom(timestamp,, GRND_TIMESTAMP), something happened that trigger an update to the opaque cookie given to getrandom(timestamp, GRND_TIMESTAMP). When such update happen, userspace is advised to discard buffered random data and retry. The meaning of the timestamp cookie is up to the kernel, and can be changed anytime. Userspace is not expected to read the content of this blob. Userspace only acts on the length returned by getrandom(,, GRND_TIMESTAMP): -1 : not supported 0 : cookie not updated, no need to discard buffered data >0 : cookie updated, userspace should discard buffered data For the cookie, I've used a single u64, but two u64 could be a better start, providing room for implementing improved behavior in future kernel versions. > Please just let me iterate on my original patchset for a little bit, > without adding more junk to the already overly large conversation. I like the simplicity of my so called "junk". It's streamlined, doesn't require a new syscall, doesn't require a new copy of ChaCha20 code. I'm sorry it doesn't fit your expectations. Regards. -- Yann Droneaud OPTEYA