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 44871C433EF for ; Wed, 2 Mar 2022 07:48:51 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S235367AbiCBHtc (ORCPT ); Wed, 2 Mar 2022 02:49:32 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49720 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231849AbiCBHtc (ORCPT ); Wed, 2 Mar 2022 02:49:32 -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 CCF5C13D4D for ; Tue, 1 Mar 2022 23:48:48 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1646207328; 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=VSCz2pxA5hTBIRgPDgOdyYSFpYrMbh4E3T7sCMIW0vU=; b=bvIWOWY2qUy3chL1HKVSZZhj30ffgJtRMW6tABNTAg9N0DmCK+lJsTRFlIE21t900G4Nnb nKn7LfpVVQeIvL/RWWI00PihqP99jspNi6AWRFoRj9LoppxzaOl8Y8acq/JmOOn+Uw5wIk qoZdtyo0z/9+A4f7cixAnQ8tHxBxx44= Received: from mail-wr1-f69.google.com (mail-wr1-f69.google.com [209.85.221.69]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-437-7anGgWJQPIS-uuNXkxGSEw-1; Wed, 02 Mar 2022 02:48:46 -0500 X-MC-Unique: 7anGgWJQPIS-uuNXkxGSEw-1 Received: by mail-wr1-f69.google.com with SMTP id o1-20020adfe801000000b001f023455317so318728wrm.3 for ; Tue, 01 Mar 2022 23:48:46 -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=VSCz2pxA5hTBIRgPDgOdyYSFpYrMbh4E3T7sCMIW0vU=; b=v1HqRafr8z/FEcm5zLi7GQqzt91VAr81L9vDLLX1rEDWTV2LJ+JxT2LzOGtXKo23Nd gGOko1PG1QbSBsfEhSxdkZzpI0StLH+sNDIqH4j4ulNFXOVYp58+V8JzJPbPRxiiEp2Z KfS6f5pw144UfVedp8BxJ3SB3QAFrSR+2p2pf4gb0JIVHv+sbt5lY0Ss/Ih7jQ/q58gW j/Tp8hPszUvpRn2Ci2WSaj/wMiXsZFGfDqJO44qNFgs22oA4ee5cphQN4MiDoS/tsP7Y 8Rjx0+nae6fh2Uf6cWFNQAgL/K16/icsGCWMPCLNDnb6Xyiy8FEhujrXB/pDsUsZudVd GWQw== X-Gm-Message-State: AOAM532rIPI+FP2OOVyVcU49+22Khz3Mkv+2bzFb2o5IGyZkYRRmSf36 zUdFvikL3GrsPlp+E6uwJSCKwgwExxDLDeLcMkNmjKLGdfIPACyF8GMkUONW/BRmjrqZEmp2ii7 vzEHHX87zVBhLtrpwEbw= X-Received: by 2002:a5d:6da1:0:b0:1e3:2bf5:13c with SMTP id u1-20020a5d6da1000000b001e32bf5013cmr22959845wrs.316.1646207325588; Tue, 01 Mar 2022 23:48:45 -0800 (PST) X-Google-Smtp-Source: ABdhPJz9fOxEBC6Q2x8n5VmxQ/dfWM6m6ZkjkZTGFJDBmExfNYsTGNqiw6xeuncf/kpMaUAwvGB/xg== X-Received: by 2002:a5d:6da1:0:b0:1e3:2bf5:13c with SMTP id u1-20020a5d6da1000000b001e32bf5013cmr22959817wrs.316.1646207325304; Tue, 01 Mar 2022 23:48:45 -0800 (PST) Received: from redhat.com ([2a10:8006:355c:0:48d6:b937:2fb9:b7de]) by smtp.gmail.com with ESMTPSA id z5-20020a05600c0a0500b0037fa93193a8sm6342218wmp.44.2022.03.01.23.48.43 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 01 Mar 2022 23:48:44 -0800 (PST) Date: Wed, 2 Mar 2022 02:48:41 -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: <20220302024608-mutt-send-email-mst@kernel.org> References: <223f858c-34c5-3ccd-b9e8-7585a976364d@redhat.com> <20220301121419-mutt-send-email-mst@kernel.org> <20220302024137-mutt-send-email-mst@kernel.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20220302024137-mutt-send-email-mst@kernel.org> Precedence: bulk List-ID: X-Mailing-List: linux-pm@vger.kernel.org On Wed, Mar 02, 2022 at 02:42:37AM -0500, Michael S. Tsirkin wrote: > 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? Oh pls ignore it, I think I got it. Resending same packet is not a problem, producing a new one is. > > 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 So how about measuring the performance impact of reading the 16 byte vmgenid then? This could be a performance option, too - some people might want extra security, some might not care. And I feel if linux DTRT and reads the 16 bytes then hypervisor vendors will be motivated to improve and add a 4 byte unique one. As long as linux is interrupt driven there's no motivation for change. -- MST