From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 38DFDC433FE for ; Wed, 2 Mar 2022 07:42:47 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236781AbiCBHn0 (ORCPT ); Wed, 2 Mar 2022 02:43:26 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33108 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235308AbiCBHnZ (ORCPT ); Wed, 2 Mar 2022 02:43:25 -0500 Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by lindbergh.monkeyblade.net (Postfix) with ESMTP id 9241612600 for ; Tue, 1 Mar 2022 23:42:40 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646206959; 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=r54KECS5Ta4+XfMPrM9TZqlD4g6ikpj26D7X7GFm2xk=; b=QMs8ba4d0AilIqnziBBUUTDmtQakhIK46ClD949Mvdto6I+vJR9LbkKT/LP1WjDIz8lA5T CMoCIDHFQzsppTGhfTaUup3MowobN69zqAzUuTgslnODl66D2sHO4dWq6uCKhYZSAkCPAG cs90gcr9rRIi1GdJgDlPUvm2q6Wtp+s= Received: from mail-wm1-f72.google.com (mail-wm1-f72.google.com [209.85.128.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-641-i_eVaZGqOYO9pR8An31ZbQ-1; Wed, 02 Mar 2022 02:42:38 -0500 X-MC-Unique: i_eVaZGqOYO9pR8An31ZbQ-1 Received: by mail-wm1-f72.google.com with SMTP id m34-20020a05600c3b2200b0038115c73361so230350wms.5 for ; Tue, 01 Mar 2022 23:42:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=r54KECS5Ta4+XfMPrM9TZqlD4g6ikpj26D7X7GFm2xk=; b=pAIPdan8RHByrl5+aCbATuPblCTWlZLYg73Gd31O8/4FnSJxqlt6Y7ICbGQiqLgsiS sF2W/MQhf2eq1VyCw5bEdb+r90/7bnnXg17gdn5B/TQkKOMJvVwKdglfgsphv4X1ddy7 F+gUjyhO1evV6Uf/WYTSaI3vVwZ2d+72mDRAyKa1WBB50LfgXCWRoc/aT0EyEv+/cJrv Vxc+nWZ3tUbM4mDxyAB7w/EKnczXn/PMX0B6hxMcGaXGWKpajVNp4jmReB7mCwG+dzlG QVwgaKt0Zi0Rl5CctUfGePsK1r/LECx91nn7aDAtZftAbFvkUazgN0oD92Gaa+wc4KVz S1Tg== X-Gm-Message-State: AOAM533bMovtaSXMLxSqL/JkybqiPeLsFiu/kn8k3rn80Ib+ETBx/h9V XOp1PFfCf1XBF5yhjNIlRvymarHb1EXGrZhx0TexxKr7mqAKVThRBKSevr/kHCtWXsVjcvh4wij z8LYmTcLhEqV9X44U8QontTE4 X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr19550326wmq.156.1646206957619; Tue, 01 Mar 2022 23:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrhIny0LTz+oAiVJdVBdcw7M1SyuYOvWiCd108UgZKej5mVsXb3i5PRUQLI/CVYzNAxiQ1tA== X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr19550301wmq.156.1646206957345; Tue, 01 Mar 2022 23:42:37 -0800 (PST) Received: from redhat.com ([2a10:8006:355c:0:48d6:b937:2fb9:b7de]) by smtp.gmail.com with ESMTPSA id n15-20020a05600c4f8f00b003842f011bc5sm1040455wmq.2.2022.03.01.23.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 23:42:36 -0800 (PST) Date: Wed, 2 Mar 2022 02:42:33 -0500 From: "Michael S. Tsirkin" To: "Jason A. Donenfeld" Cc: Laszlo Ersek , LKML , KVM list , QEMU Developers , linux-hyperv@vger.kernel.org, Linux Crypto Mailing List , Alexander Graf , "Michael Kelley (LINUX)" , Greg Kroah-Hartman , adrian@parity.io, Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= , Dominik Brodowski , Jann Horn , "Rafael J. Wysocki" , "Brown, Len" , Pavel Machek , Linux PM , Colm MacCarthaigh , Theodore Ts'o , Arnd Bergmann Subject: Re: propagating vmgenid outward and upward Message-ID: <20220302024137-mutt-send-email-mst@kernel.org> References: <223f858c-34c5-3ccd-b9e8-7585a976364d@redhat.com> <20220301121419-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org On Tue, Mar 01, 2022 at 07:37:06PM +0100, Jason A. Donenfeld wrote: > Hi Michael, > > On Tue, Mar 1, 2022 at 6:17 PM Michael S. Tsirkin wrote: > > Hmm okay, so it's a performance optimization... some batching then? Do > > you really need to worry about every packet? Every 64 packets not > > enough? Packets are after all queued at NICs etc, and VM fork can > > happen after they leave wireguard ... > > Unfortunately, yes, this is an "every packet" sort of thing -- if the > race is to be avoided in a meaningful way. It's really extra bad: > ChaCha20 and AES-CTR work by xoring a secret stream of bytes with > plaintext to produce a ciphertext. If you use that same secret stream > and xor it with a second plaintext and transmit that too, an attacker > can combine the two different ciphertexts to learn things about the > original plaintext. So what about the point about packets queued then? You don't fish packets out of qdisc queues, do you? > But, anyway, it seems like the race is here to stay given what we have > _currently_ available with the virtual hardware. That's why I'm > focused on trying to get something going that's the least bad with > what we've currently got, which is racy by design. How vitally > important is it to have something that doesn't race in the far future? > I don't know, really. It seems plausible that that ACPI notifier > triggers so early that nothing else really even has a chance, so the > race concern is purely theoretical. But I haven't tried to measure > that so I'm not sure. > > Jason From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id B1F51C433F5 for ; Wed, 2 Mar 2022 07:43:40 +0000 (UTC) Received: from localhost ([::1]:43832 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1nPJe7-0004CZ-B4 for qemu-devel@archiver.kernel.org; Wed, 02 Mar 2022 02:43:39 -0500 Received: from eggs.gnu.org ([209.51.188.92]:39890) by lists.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPJdH-0003W7-GN for qemu-devel@nongnu.org; Wed, 02 Mar 2022 02:42:47 -0500 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]:25230) by eggs.gnu.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.90_1) (envelope-from ) id 1nPJdB-0007k4-Vx for qemu-devel@nongnu.org; Wed, 02 Mar 2022 02:42:44 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646206960; 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=r54KECS5Ta4+XfMPrM9TZqlD4g6ikpj26D7X7GFm2xk=; b=cw8cEjwtKGHOv3OYdt3dcxaE388U8YaebEfjyft3HLQk52+f8kLk5SLlNFFeMf4ZvgclRa tWekZQ0R7LxzRrqrtdT6aggY98zMpN/rVK0QFQVRrTKCcCz/n3R1swauxIrkfLDAU6NRJ0 LNqE3aucoohIPvbMj1/nvKQxqXki9vo= Received: from mail-wm1-f69.google.com (mail-wm1-f69.google.com [209.85.128.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-223-PsUQqfi2NC2QQDiTjVmFyw-1; Wed, 02 Mar 2022 02:42:39 -0500 X-MC-Unique: PsUQqfi2NC2QQDiTjVmFyw-1 Received: by mail-wm1-f69.google.com with SMTP id az36-20020a05600c602400b003811b328ed5so228602wmb.4 for ; Tue, 01 Mar 2022 23:42:38 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=r54KECS5Ta4+XfMPrM9TZqlD4g6ikpj26D7X7GFm2xk=; b=PnWY1DzUryVN7vrTgeBn8GtMHN4jx0mA1NcFbZKhMnCN+LXETVO2h21nSJy9qt2vg7 YGfaQDF8aAESy9pUGjJ3pECOIid8ECncf5jh+JxThn51qLS9dCWRK7ZKYG9Yi80Ld9HX 7zTgvuo4kg9U4LUbGuAWB9em9BpEuD9N82brKXFNsBVwKmcL3qbPOvW8xyNijVqJe0io 4qZNG0egR/VBxx9PdFIV1+rLsSzDRjwDeloeFiAUC6UWtn0vVMYg6Xay3ggYdna6bkzG lpcxGYSrUJXUUKf0hnUGnAdYHIsgkmjGRd6D+1TTWtFTg6OfgR9iis8/La6cFk5DGkAR HWug== X-Gm-Message-State: AOAM5339QOSSzhm8cjPFSl+n5XHYZzfioySu0iEAZVXlSIu6vJw9UKDo EafSf0VNHBglJWc86Mo/ph/hGrET/nX+a4QGsp2Yq05h9BCJ4C2jdgUzza0ZcLGKBjX9AH4uDzI 92slZdYDSKf+yeps= X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr19550329wmq.156.1646206957643; Tue, 01 Mar 2022 23:42:37 -0800 (PST) X-Google-Smtp-Source: ABdhPJwrhIny0LTz+oAiVJdVBdcw7M1SyuYOvWiCd108UgZKej5mVsXb3i5PRUQLI/CVYzNAxiQ1tA== X-Received: by 2002:a05:600c:4ed0:b0:37b:e983:287b with SMTP id g16-20020a05600c4ed000b0037be983287bmr19550301wmq.156.1646206957345; Tue, 01 Mar 2022 23:42:37 -0800 (PST) Received: from redhat.com ([2a10:8006:355c:0:48d6:b937:2fb9:b7de]) by smtp.gmail.com with ESMTPSA id n15-20020a05600c4f8f00b003842f011bc5sm1040455wmq.2.2022.03.01.23.42.34 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 23:42:36 -0800 (PST) Date: Wed, 2 Mar 2022 02:42:33 -0500 From: "Michael S. Tsirkin" To: "Jason A. Donenfeld" Subject: Re: propagating vmgenid outward and upward Message-ID: <20220302024137-mutt-send-email-mst@kernel.org> References: <223f858c-34c5-3ccd-b9e8-7585a976364d@redhat.com> <20220301121419-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 In-Reply-To: Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=mst@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Received-SPF: pass client-ip=170.10.129.124; envelope-from=mst@redhat.com; helo=us-smtp-delivery-124.mimecast.com X-Spam_score_int: -28 X-Spam_score: -2.9 X-Spam_bar: -- X-Spam_report: (-2.9 / 5.0 requ) BAYES_00=-1.9, DKIMWL_WL_HIGH=-0.082, DKIM_SIGNED=0.1, DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1, RCVD_IN_DNSWL_LOW=-0.7, RCVD_IN_MSPIKE_H5=0.001, RCVD_IN_MSPIKE_WL=0.001, SPF_HELO_NONE=0.001, SPF_PASS=-0.001, T_SCC_BODY_TEXT_LINE=-0.01 autolearn=ham autolearn_force=no X-Spam_action: no action X-BeenThere: qemu-devel@nongnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Cc: "Brown, Len" , linux-hyperv@vger.kernel.org, Colm MacCarthaigh , Daniel =?iso-8859-1?Q?P=2E_Berrang=E9?= , adrian@parity.io, KVM list , Jann Horn , Greg Kroah-Hartman , Linux PM , "Rafael J. Wysocki" , LKML , Dominik Brodowski , QEMU Developers , Alexander Graf , Linux Crypto Mailing List , Pavel Machek , Theodore Ts'o , "Michael Kelley \(LINUX\)" , Laszlo Ersek , Arnd Bergmann Errors-To: qemu-devel-bounces+qemu-devel=archiver.kernel.org@nongnu.org Sender: "Qemu-devel" On Tue, Mar 01, 2022 at 07:37:06PM +0100, Jason A. Donenfeld wrote: > Hi Michael, > > On Tue, Mar 1, 2022 at 6:17 PM Michael S. Tsirkin wrote: > > Hmm okay, so it's a performance optimization... some batching then? Do > > you really need to worry about every packet? Every 64 packets not > > enough? Packets are after all queued at NICs etc, and VM fork can > > happen after they leave wireguard ... > > Unfortunately, yes, this is an "every packet" sort of thing -- if the > race is to be avoided in a meaningful way. It's really extra bad: > ChaCha20 and AES-CTR work by xoring a secret stream of bytes with > plaintext to produce a ciphertext. If you use that same secret stream > and xor it with a second plaintext and transmit that too, an attacker > can combine the two different ciphertexts to learn things about the > original plaintext. So what about the point about packets queued then? You don't fish packets out of qdisc queues, do you? > But, anyway, it seems like the race is here to stay given what we have > _currently_ available with the virtual hardware. That's why I'm > focused on trying to get something going that's the least bad with > what we've currently got, which is racy by design. How vitally > important is it to have something that doesn't race in the far future? > I don't know, really. It seems plausible that that ACPI notifier > triggers so early that nothing else really even has a chance, so the > race concern is purely theoretical. But I haven't tried to measure > that so I'm not sure. > > Jason