From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from firstgate.proxmox.com (firstgate.proxmox.com [212.224.123.68]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits)) (No client certificate requested) by lists.proxmox.com (Postfix) with ESMTPS id 3E5106CAFE for ; Tue, 10 Aug 2021 09:49:08 +0200 (CEST) Received: from firstgate.proxmox.com (localhost [127.0.0.1]) by firstgate.proxmox.com (Proxmox) with ESMTP id 30E1FD561 for ; Tue, 10 Aug 2021 09:49:08 +0200 (CEST) Received: from proxmox-new.maurer-it.com (proxmox-new.maurer-it.com [94.136.29.106]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by firstgate.proxmox.com (Proxmox) with ESMTPS id D57E3D551 for ; Tue, 10 Aug 2021 09:49:03 +0200 (CEST) Received: from proxmox-new.maurer-it.com (localhost.localdomain [127.0.0.1]) by proxmox-new.maurer-it.com (Proxmox) with ESMTP id A5A8F43186; Tue, 10 Aug 2021 09:48:57 +0200 (CEST) To: Proxmox VE development discussion , Nick Chevsky References: <20210715142319.1457131-1-s.reiter@proxmox.com> <20210715142319.1457131-3-s.reiter@proxmox.com> From: Stefan Reiter Message-ID: Date: Tue, 10 Aug 2021 09:48:55 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:78.0) Gecko/20100101 Thunderbird/78.12.0 MIME-Version: 1.0 In-Reply-To: Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit X-SPAM-LEVEL: Spam detection results: 0 AWL 0.590 Adjusted score from AWL reputation of From: address BAYES_00 -1.9 Bayes spam probability is 0 to 1% KAM_DMARC_STATUS 0.01 Test Rule for DKIM or SPF Failure with Strict Alignment NICE_REPLY_A -0.001 Looks like a legit reply (A) SPF_HELO_NONE 0.001 SPF: HELO does not publish an SPF Record SPF_PASS -0.001 SPF: sender matches SPF record URIBL_BLOCKED 0.001 ADMINISTRATOR NOTICE: The query to URIBL was blocked. See http://wiki.apache.org/spamassassin/DnsBlocklists#dnsbl-block for more information. [proxmox.com, qemuserver.pm] Subject: Re: [pve-devel] [RFC qemu-server 2/2] fix #3075: add TPM v1.2 and v2.0 support via swtpm X-BeenThere: pve-devel@lists.proxmox.com X-Mailman-Version: 2.1.29 Precedence: list List-Id: Proxmox VE development discussion List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 10 Aug 2021 07:49:08 -0000 On 09/08/2021 20:17, Nick Chevsky wrote: > Hi Stefan, > > Thank you for your work on this; I've been testing it locally for a few > weeks and have since contributed improved Debian packaging and other fixes > upstream [3]. Please see my comment below the quoted code: Thanks for your upstream work! I've seen some of those changes already, they'll certainly help a lot. As a status update to this in general, since we decided that storing data on /etc/pve is a no-go and don't have a generic dir backend for all use-cases we want to support, I have also started working with upstream (based on some prior work being done in a current draft PR [0]) to support block devices as a native backend [1]. With that in place, we should be able to use our existing storage infrastructure for storing TPM state. [0] https://github.com/stefanberger/swtpm/pull/490 [1] https://github.com/stefanberger/swtpm/pull/513 > > --- a/PVE/QemuServer.pm >> +++ b/PVE/QemuServer.pm >> ... >> +sub start_swtpm { >> ... >> + my $setup_cmd = [ >> + "swtpm_setup", >> + "--tpmstate", >> + "$tmppath", >> + "--createek", >> + "--create-ek-cert", >> + "--create-platform-cert", >> + "--lock-nvram", >> + "--config", >> + "/etc/swtpm_setup.conf", # do not use XDG configs >> + "--runas", >> + "0", # force creation as root, error if not possible >> > > Could you add --terminate to this argument array? That's the documented, > correct way of achieving the behavior we want (i.e. swtpm automatically > terminating along with QEMU). Currently this is already happening even > without --terminate, but that's a side effect of two bugs: one for which > I've already contributed a fix upstream [1], and another which will be > fixed once consumers (e.g. PVE, libvirt) start using --terminate (which > they should've been using all along) [2]. Adding --terminate is innocuous > and guarantees the current behavior will stay the same after the second bug > is fixed upstream. Good to hear the explanation behind it, but '--terminate' is already added - you're just looking at the 'swtpm_setup' command, check the lines below that, specifically '$emulator_cmd'. > > [1] > https://github.com/stefanberger/swtpm/commit/6961ec4878b4a569ac53f6e6f77416b44f3f26d9 > [2] https://github.com/stefanberger/swtpm/pull/509#issuecomment-890412478 > [3] https://github.com/stefanberger/swtpm/pulls?q=author%3Anchevsky > > Nick > _______________________________________________ > pve-devel mailing list > pve-devel@lists.proxmox.com > https://lists.proxmox.com/cgi-bin/mailman/listinfo/pve-devel > >