Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1078424rdb; Tue, 30 Jan 2024 07:20:34 -0800 (PST) X-Google-Smtp-Source: AGHT+IH3/GZvHnm8ixXAXh3bFv3Njtu5EQ1cU/Nqtemw9oXrvzAqBPh+lsmopsqFygJJjk+FGiWS X-Received: by 2002:a05:6a20:411f:b0:19c:97b8:abb2 with SMTP id y31-20020a056a20411f00b0019c97b8abb2mr1551889pze.48.1706628034530; Tue, 30 Jan 2024 07:20:34 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706628034; cv=pass; d=google.com; s=arc-20160816; b=Y95XbpOt4mcPUsk01c5jQ/wSOQ38F55IOBsCjdnTDLDrde/U5HT5RX+SmaugcRPt8Y /Nqv8le1rmICtceID6lpWF328kKiIfdz1npZPz8MFUz5gFJPMOEUVjk/8eiP/5XA2qce /at9B/gGLpaqHdAhvAnfUkjNmN5a1bObXiLotN9rOVKPxSnSapFJM8ODx6kf1p4UZ2ux 12FTfhJ06zjwwYpQYwCbG7hyqox66uUH/8K8oYI0cO9GiQZgIpIXpcSCFpgTRFtTKFPB F0zNgGFvQPoGtvpvXPfWOguKt7kvdCBRQW9MjUhKRsyVxYuAUBmEhseJfeFXM8tRHLvQ vR8Q== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-transfer-encoding:content-disposition :mime-version:list-unsubscribe:list-subscribe:list-id:precedence :references:message-id:subject:cc:to:from:date:dkim-signature; bh=CE+dHfwhchbF76+8SdQnvFtWXgv6n6pDLWAAkhWYuhY=; fh=AASOwyBMnmqLQWwsqHS2dbm4o48Z0OnKIaLm0KrBK1o=; b=Lbrqq2KTF4Jy63Dmy6Vk6T1ZG0ykG5MxCRCwOYqsunoXZZRaNAgthavCxEupzLcaqy jErrxbfVv/Z0uzZtiHrPAMRBaU7AzdbTbXpxcBBXayHpQy/IxvGpxFiQ/UGLnPR1bYMG AxRM2lJOQW688NTMSqjLJ3H6ai+XOu/AtqMF9ORdKnIOIwfdWrJ+8D63IehqgXNcYl9M b8YV45YMl2v118/GsXjYJCYc7+/EQxeja4BppCw8W8WcC+Rgc92niXNn+QTurWVWUBy6 kJe/ez+dQhhQ/7Z4RK91VD5B7iPM4bfgHhXO5cygYdbmQhte7CYYkzY4v+vtap/Jdhcb EruQ== ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=fYHyC8VM; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-44811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44811-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from sy.mirrors.kernel.org (sy.mirrors.kernel.org. [2604:1380:40f1:3f00::1]) by mx.google.com with ESMTPS id b75-20020a63344e000000b005cd84b844edsi7416196pga.604.2024.01.30.07.20.34 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Tue, 30 Jan 2024 07:20:34 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-44811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) client-ip=2604:1380:40f1:3f00::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=fYHyC8VM; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-44811-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:40f1:3f00::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-44811-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 sy.mirrors.kernel.org (Postfix) with ESMTPS id 52AA2B283A2 for ; Tue, 30 Jan 2024 15:12:35 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id A6AE560ED9; Tue, 30 Jan 2024 15:12:27 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="fYHyC8VM" 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 8498654F94; Tue, 30 Jan 2024 15:12:26 +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=1706627546; cv=none; b=BUnIdP45dSjY3qeXADmUyETphwFgMbKGTzR88trg9iQ7leFRGWdJmi1bxJhjUe9e6veykbg2ltXF76Vw8gtDoI2mYlAn4FOFbRqEXU3qwZT1oP3QyTf4yFMIYXNiJC13Qwwu4TaY9E+uL/TZ/ZZC5Z9XKRPTIKjqZ2EZUyF5Ubs= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706627546; c=relaxed/simple; bh=mND0/asZNEjOD27agRTV1UOdcbQ9NaBVstFsI7+cWZc=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=gVxPqTc4Gnm/R6QuTzGBIvJ3hH+sly0Bq9kNBNf8YQGtHVe8TBnc3HmP7WOsPx+TRpEsy2DoZLBSaK7WKE7ADWOIXQIy8qedV+tLIQgBBGwbbf+utHugY2aIxY75OpUHFjjbMdT1g597nhJ4ZE+W6cngA8ctVuNhkxntxIQe/Ug= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=fYHyC8VM; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 559EEC433F1; Tue, 30 Jan 2024 15:12:24 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="fYHyC8VM" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1706627542; 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=CE+dHfwhchbF76+8SdQnvFtWXgv6n6pDLWAAkhWYuhY=; b=fYHyC8VMnKFjridhhmbE30U+37ezIZg1lnRsT+RTZdNcyK5/Io9NCQCkOSJyRltBfKOyMD KVpaLvYMLJdKrLlVMtcBchYysH98nDW0OLV8rn9rVtcZQ/X89q0j/6WTerC6UAcLQ9Kvfa T20Ef0+WgIQ0av4WyqHgdlyqszj3uYQ= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id c91b9cdd (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Tue, 30 Jan 2024 15:12:22 +0000 (UTC) Date: Tue, 30 Jan 2024 16:12:22 +0100 From: "Jason A. Donenfeld" To: Daniel =?utf-8?B?UC4gQmVycmFuZ8Op?= Cc: "Reshetova, Elena" , "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" Subject: Re: [PATCH 1/2] x86/random: Retry on RDSEED failure Message-ID: References: <20240130083007.1876787-1-kirill.shutemov@linux.intel.com> Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: On Tue, Jan 30, 2024 at 02:43:19PM +0000, Daniel P. Berrangé wrote: > On Tue, Jan 30, 2024 at 03:06:14PM +0100, Jason A. Donenfeld wrote: > > Is that an accurate summary? If it is, then the actual problem is that > > the hardware provided to solve this problem doesn't actually solve it > > that well, so we're caught deciding between guest-guest DoS (some > > other guest on the system uses all RDRAND resources) and cryptographic > > failure because of a malicious host creating a deterministic > > environment. > > In a CoCo VM environment, a guest DoS is not a unique threat > scenario, as it is unrelated to confidentiality. Ensuring > fair subdivision of resources between competeing guests is > just a general VM threat. There are many easy ways a host > admin can stop a guest making computational progress. Simply > not scheduling the guest vCPU threads is one. CoCo doesn't > try to solve this problem. > > Preserving confidentiality is the primary aim of CoCo. > > IOW, if the guest boot is stalled because the kernel is spinning > waiting on RDRAND to return data, that's fine. If the kernel > panics after "n" RDRAND failures in a row that's fine too. They > are both just yet another DoS scenario. > > If the kernel ignores the RDRAND failure and lets it boot with > degraded RNG state there were susceptible to attacks, that would > not be OK for CoCo. Yea, that's why I said "we're caught deciding..." One case is a DoS that would affect all VMs, so while one guest preventing new guests from booting seems like not a CoCo problem, yes, it is still a problem. At least in theory. And in practice this is easy with RDSEED too. In practice, could you actually indefinably starve RDRAND between guests? Is this pretty easy to do with a little tinkering, or is this a practically impossible DoS vector? I don't actually know.