Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1647350rdb; Wed, 31 Jan 2024 05:14:59 -0800 (PST) X-Google-Smtp-Source: AGHT+IGX8UiGVmvcG6qnFu/08cOZP6DhFH40gT6kLSPlsraEEoJLzc9WWP1yino42a0C86HHH7ih X-Received: by 2002:a05:6402:1b04:b0:55f:2958:7b26 with SMTP id by4-20020a0564021b0400b0055f29587b26mr4756401edb.8.1706706898887; Wed, 31 Jan 2024 05:14:58 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706706898; cv=pass; d=google.com; s=arc-20160816; b=Y0DjyB3I2GRNHQ4+8dQAeItb0bsn/y7Fx+0iX4BQ3EqkcQegB4qUPL/z2yawXtf0Q5 qowUAGqcOe1q3EUsEJp1k8g10jWFV/hVAXHxlIzSIjugFN4Jm++zIE7lFynp44dNhMEr XY3J62QKTfU/Hi6WmuDXO7PzMzPhZVLpppfVPOCekzkMclta3+RHK9y4v9X6QWls/syl VJytR6S1a/pth+mc50A7cQiln5pngRfLvEdBX37ojzja7N7SFhWZFINMwq5+pRs09gfO H0rVP/vcnE2M7l957WgMahwLfKO8+6wd2q9hxFnClQzryHeAtkAiCKRg5HA6q8XhFczb V8tA== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:list-unsubscribe:list-subscribe :list-id:precedence:dkim-signature; bh=Nf7Dsr8EZJZ/9+wMClmS4IGj8jjb2jaLazmD3JQsIjs=; fh=PZgLaGesM6MzRwv/0nyLu2HXP2wqBJaMCnqNJE/L/gY=; b=i3ddJEiTUD+T8+WMkU/xVT9P99p/BRIbMbfVdYDnqhjN6VbTRAkIWwlc6zdBD1t/5W lZFIH1XPvU4Cc5Q1pJ/g76AtEJg33/6JXn9L1gN/QBVfQIo2Z18w/fH0je+8st0HtO7W JuLHBiWNOku/lHTTcytpmwjFt5X2GL7fqjuLt6akQ3OwDlWjUXYQbttopEmL4Pj7Xgm1 S/Yh26qWOKJaiFt7v0XTbjomwzKnKlyD5SfU2a61yY/CbaLhyN+6VVXNQXb0bUX1QSzf FxDMU6BtuElZfXhJJYXSRElq6UyPiy9MGL3jX+C/7goMsAl9BQeHWRQ343jLiFo/1RrD wLYA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=LeTBhhlf; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46473-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com X-Forwarded-Encrypted: i=1; AJvYcCWBM6ge0c4Yjl9j6met+9ewvmuV7JLBex+L+UnlCJlcBtHkMXvsogGf+nrzXkm9uvnquGy8k+nHToBWGF5MsMSStZOsIbdV7GFtkSCXow== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id p6-20020a05640243c600b0055ee21d6135si3905669edc.352.2024.01.31.05.14.58 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 05:14:58 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) client-ip=147.75.80.249; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=LeTBhhlf; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46473-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46473-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: from smtp.subspace.kernel.org (wormhole.subspace.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by am.mirrors.kernel.org (Postfix) with ESMTPS id 9FF121F29DD2 for ; Wed, 31 Jan 2024 13:14:58 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id BDE5A7D3E1; Wed, 31 Jan 2024 13:14:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="LeTBhhlf" Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id CE1D97BB01 for ; Wed, 31 Jan 2024 13:14:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706706871; cv=none; b=XpadCfIkfXMZD+34psFsnmybLw0Y7EaMpECbxHHeHobjU7ITiQLIm3/u9hqzY4IFnRglJy/W3NiXbJHKKIIzB7/KLWEoc9B+Xm18iExWqaKQLErfph+1GaSMyKFKO8mVfQC1s/g33+C6JMl9x0GyrxXI/GqNmb5XvaXWCT2tEks= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706706871; c=relaxed/simple; bh=Nf7Dsr8EZJZ/9+wMClmS4IGj8jjb2jaLazmD3JQsIjs=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=WkFkAlAGho3bOiS4ZXdRsGaze5GE/e7sEnXG9rA089lvOxZN26+rnbX0P6ZCYl3dPXKfFjoJfkAv+wFEZH10PqJQNq63nEtSdF8X2syGBxvhE++tL6MJdHhVUSMVLzuBuYsHtag0VNGu4XC1r+BnEQl1sj7Jmkt2jCNxkEcze/A= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=LeTBhhlf; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 26F24C43390 for ; Wed, 31 Jan 2024 13:14:31 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="LeTBhhlf" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1706706867; 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: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=Nf7Dsr8EZJZ/9+wMClmS4IGj8jjb2jaLazmD3JQsIjs=; b=LeTBhhlfRubCzCvTnrCld87vvpqNbt0RklPmCJWEZGjaRrXz3r3h/ZsTQ823q96rlw4Lak YwG3eja7w39qIDT0M3L1cBrWfKmi4Hvg+Fvf8L/n5+rfVrGYxjhBdpg+LGKjmHOBoQcQv5 htXDG9QrhnEk5qrdqNK3APKqasptwYQ= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8e0e383d (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 31 Jan 2024 13:14:27 +0000 (UTC) Received: by mail-yb1-f172.google.com with SMTP id 3f1490d57ef6-dc256e97e0aso3484505276.2 for ; Wed, 31 Jan 2024 05:14:27 -0800 (PST) X-Gm-Message-State: AOJu0Yxr1/QD2H0SsfMfeo7/oKBeF6wcosM6sBloJFot+/YZ0B/rx72p cGVtY7C4CTuMrmzjj5x3TC9Jf044xLVQl9jIBLIN2Y2sA0JEYF/botdUbFYTPrOcomIPLu54sMa kYhP+xXx54hJEkZd1c75W2CYLcBc= X-Received: by 2002:a25:1846:0:b0:dc2:547f:27a2 with SMTP id 67-20020a251846000000b00dc2547f27a2mr1406802yby.50.1706706865823; Wed, 31 Jan 2024 05:14:25 -0800 (PST) Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 References: <20240130083007.1876787-1-kirill.shutemov@linux.intel.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Wed, 31 Jan 2024 14:14:14 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 1/2] x86/random: Retry on RDSEED failure To: "Reshetova, Elena" Cc: "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "x86@kernel.org" , "Theodore Ts'o" , Kuppuswamy Sathyanarayanan , "Nakajima, Jun" , Tom Lendacky , "Kalra, Ashish" , Sean Christopherson , "linux-coco@lists.linux.dev" , "linux-kernel@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable On Wed, Jan 31, 2024 at 8:56=E2=80=AFAM Reshetova, Elena wrote: > So given this, I would personally consider the virtual guest TSC value > observable by host/VMM. > [2] TDX module source code: > https://www.intel.com/content/www/us/en/download/738875/782152/intel-trus= t-domain-extension-intel-tdx-module.html Thanks for the explanation and link. Indeed if this is all mediated by the host, we're in bad shape. > For the high resolution timers, host controls guest apic timers and inter= rupts fully. > So, it has the power to see and even affect when a certain interrupt happ= ens > or doesnt happen in the guest. It can delay guest timers at its will on p= retty > extensive time periods. This seems powerful enough for me. > Things like HPET are also fully under host control. And I suppose RDPMC is similar? And it's not like the guest can just take an excessive amount of TSC samples and randomly select which ones it uses because chickens and eggs... The situation you paint is that all of our entropy inputs -- timers, rdrand, etc -- are either host controllable, host observable, or host (and guest sibling) DoS'able, so if you don't trust the host, there are no good inputs. That's not a great position to be in, and I wonder if something can be done on the hardware side to remedy it, as this seems like a major shortcoming in TDX. So far, all of the proposed mitigations introduce some other DoS. > Yes, in practice there will be physical hw underneath, but the problem im= o is > that the host is in between and still very powerful when it comes to inte= rrupts and > timers at the moment. Sure sounds like it. Jason