Received: by 2002:a6b:500f:0:0:0:0:0 with SMTP id e15csp202444iob; Mon, 2 May 2022 17:05:43 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwKish/05kSkG0O74uZz/V5w6JQu5yr24emJUns90fkNlNpxHyhJW5H6R71VcQ1IJT6VtZh X-Received: by 2002:a17:902:ecc8:b0:15e:9e46:cb7e with SMTP id a8-20020a170902ecc800b0015e9e46cb7emr9015052plh.111.1651536343123; Mon, 02 May 2022 17:05:43 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1651536343; cv=none; d=google.com; s=arc-20160816; b=fegdiFgPu039WbUHkXrA74hza6qHtCGJ0ipk15GD5NjIfLkEnly4HuBqla2DIvzmRn ro1ElJ6P77/DRptSiLv/9v163V5dvtCN0noY/Oab9R3rBdxI8v3I7AX5rN8wgekWSKm/ kQiBs/+jk8DJBuxY6oPp7+C9rzjWV+fL3pJeGm6WLPiLmu+jpvMIEbcQz8Zqb/6FU71R xBLO/2dP40TPZT01HZhJ1PayESw2d72VKeT9eM5RzbagV2oxd47jJMBQ9CdeOAW1N6fA W4jPmpW7PUceE6TmQYIroUhSAKUGkPVvioPMnvUNr80BHdhskPN1TcgaIc5e+HlivqK5 VQRA== 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=JthCT2QbwaNt2DB/F/sxRyKukGJ0r6w86ZPxmmA4K2I=; b=txMHbuOP9RMqgI2e1Z1fn4blDjA5YZsJTvE64zQIublvOPVbboiB8XD6Ynb+3QzFnU bhdDy0md8E9Wk+oN2xhKwN9lnMmk19zgMgDH56CKzjdaeiz4ambSZQqhBGt7Ckus0ZmP v7qoMT1mNCZHqHVjb3miLUdyHPQOgt+gZ59u9mUIaDmbWflFN030NbN01Lbv8lqPPA8T 5em1jNc3vinE5kMbKpOn+NWx/vso7EgfHw8XbYClvS3IYF6u49OWGkRMEEeUpHpDQMD3 SoMhg4QPScWd6NrGQxj1mfpzB8De/U8Kg3cv/7dh3WRBoePX7C1GUD2L+K3MLPKAyue1 RGNQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZTIUL47t; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Return-Path: Received: from lindbergh.monkeyblade.net (lindbergh.monkeyblade.net. [2620:137:e000::1:18]) by mx.google.com with ESMTPS id c23-20020a170902b69700b0015d0db0168csi14917756pls.364.2022.05.02.17.05.42 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 02 May 2022 17:05:43 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) client-ip=2620:137:e000::1:18; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZTIUL47t; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:18 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=zx2c4.com Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 5C25D340F5; Mon, 2 May 2022 17:05:10 -0700 (PDT) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1386145AbiEBQPo (ORCPT + 99 others); Mon, 2 May 2022 12:15:44 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:57856 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1386111AbiEBQPl (ORCPT ); Mon, 2 May 2022 12:15:41 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 6CD9EBC93; Mon, 2 May 2022 09:12:12 -0700 (PDT) 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 27141B8187D; Mon, 2 May 2022 16:12:11 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id DAA36C385A4; Mon, 2 May 2022 16:12:08 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ZTIUL47t" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1651507927; 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=JthCT2QbwaNt2DB/F/sxRyKukGJ0r6w86ZPxmmA4K2I=; b=ZTIUL47tvZtuvCUjjZMxKFfCRkY8sopVe/HQ8NTwyO2noS3cv31HHMJV6NvUrCSpQ5dHy8 EjGU0nc0qviHQVdS3wDIY9FPoGDdY52b6Axrn3EkE76PlJx6kWhx1v6LPgD05WgaAxEkV+ YSxaN3oHZ8Khpp6ZW3HdGY+r4UpC91k= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id d724f6c4 (TLSv1.3:AEAD-AES256-GCM-SHA384:256:NO); Mon, 2 May 2022 16:12:06 +0000 (UTC) Date: Mon, 2 May 2022 18:12:03 +0200 From: "Jason A. Donenfeld" To: Lennart Poettering Cc: linux-kernel@vger.kernel.org, linux-crypto@vger.kernel.org, Dominik Brodowski , Greg Kroah-Hartman , Theodore Ts'o , Alexander Graf , Colm MacCarthaigh , Torben Hansen , Jann Horn Subject: Re: [PATCH 2/2] random: add fork_event sysctl for polling VM forks Message-ID: References: <20220502140602.130373-1-Jason@zx2c4.com> <20220502140602.130373-2-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=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RDNS_NONE,SPF_HELO_NONE,T_SCC_BODY_TEXT_LINE autolearn=no 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 Mon, May 02, 2022 at 05:40:02PM +0200, Lennart Poettering wrote: > On Mo, 02.05.22 16:06, Jason A. Donenfeld (Jason@zx2c4.com) wrote: > > > In order to inform userspace of virtual machine forks, this commit adds > > a "fork_event" sysctl, which does not return any data, but allows > > userspace processes to poll() on it for notification of VM forks. > > > > It avoids exposing the actual vmgenid from the hypervisor to userspace, > > in case there is any randomness value in keeping it secret. Rather, > > userspace is expected to simply use getrandom() if it wants a fresh > > value. > > Wouldn't it make sense to expose a monotonic 64bit counter of detected > VM forks since boot through read()? It might be interesting to know > for userspace how many forks it missed the fork events for. Moreover it > might be interesting to userspace to know if any fork happened so far > *at* *all*, by checking if the counter is non-zero. "Might be interesting" is different from "definitely useful". I'm not going to add this without a clear use case. This feature is pretty narrowly scoped in its objectives right now, and I intend to keep it that way if possible. (And yes, I realize that is likely considerably different from your development philosophy.) > > (Ideally that counter file would even be mmapable...) You missed the last year of discussion about this and why we have wound up here as a first step. Check the archives for extensive discussion. Jason