Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1715505rdb; Wed, 31 Jan 2024 07:07:40 -0800 (PST) X-Google-Smtp-Source: AGHT+IHgoGKm2cGnLVfC3RVsIrkkidOCIkskkW2M16Apw55FuSxaSp5oyIsduQUIwnryjxm8mjPo X-Received: by 2002:a05:6830:100d:b0:6e1:34d7:27b1 with SMTP id a13-20020a056830100d00b006e134d727b1mr1688612otp.8.1706713660400; Wed, 31 Jan 2024 07:07:40 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706713660; cv=pass; d=google.com; s=arc-20160816; b=X2asPyy+1sW+/4wAmBZjUZgK7MudaVEf3iB5KevwmtTnk2vOZhJhbyNsTLq7YIfSJR 3zvTjQ8IQs7Azs8sNatUuQrNyscB8X7YdvbZ1a1vobthaJQys7tEuAMrNdroYbHR/3V3 HoVZD6hcw8Wtp6Sb6gXypCdC0OzJlYwXQ0R3R/aSamRTpjG5fCkDOQjAh0Sv+J0vCn4m 5J35vcLJetc/0mAaclc1GeS+cNcqQC47gBzZ0EFyGRkYWmbfJgkFNUo3R//89vm4egIN SbNdWqd4lnNVpOhsn3Q3/3qQO6yTyoju1lAgX7VPMb1LSFy3tzv7Jn7nafy+OpZR4ueu O/xw== ARC-Message-Signature: i=2; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=in-reply-to:content-disposition:mime-version:list-unsubscribe :list-subscribe:list-id:precedence:references:message-id:subject:cc :to:from:date:dkim-signature; bh=08V5Tn/E3QHiknxLw9Mvmg79PQM1lmEyJEgFVM+dfA0=; fh=rl/jE239dNedeBJE7pxEzCCyiXUCLHu5IqtPsm2HTq8=; b=XHkkf19LitmXXQPG7GdwzE0mzfVqi01f0MZEJtyj6aJ09HqdT8uRRvU4XEWKnu/wgL tzMA4CbU/cdqyVORKV2HzhVP9Pg6dcKLpY3YFvHGX4bFtvfhOk3hew2BKKkvvghD8B8z LIrUcgQG/DYy4okulwbZp4LofFEIvzkTAHTKKaGT49mTlkjwwoJibjGumM7FyJX7AFKO 0woeUKd9i3hU/Is5l66jIHI5gvrirk8I4yWJo7WfJcf7wA/8ymon0z0ZkmRANbJmvaDw y6W45I9qMSivpIDRVKSXnN+aHUYPEUKmrs52xfiTP6wJSotvBrF7T1U01jdF362+s71G 2PIA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZM5My5wo; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46663-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; AJvYcCVHzGF3pJvIe7BZrLbtBgMY9xdGAuopogAUh2SNlm4/eoWRg5w042nJZ/AGwEGtz4Q52V0al9gDn9YO/8jPvajNz7eQQi4BOe2qrrtL9Q== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [2604:1380:45e3:2400::1]) by mx.google.com with ESMTPS id s31-20020a0568302a9f00b006dc194673aesi4012277otu.61.2024.01.31.07.07.40 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 07:07:40 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) client-ip=2604:1380:45e3:2400::1; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b=ZM5My5wo; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46663-linux.lists.archive=gmail.com@vger.kernel.org designates 2604:1380:45e3:2400::1 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46663-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 sv.mirrors.kernel.org (Postfix) with ESMTPS id 9298029619C for ; Wed, 31 Jan 2024 14:59:46 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id DBF0484A3F; Wed, 31 Jan 2024 14:52:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ZM5My5wo" 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 E674A84A52; Wed, 31 Jan 2024 14:52:30 +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=1706712751; cv=none; b=UegH0DUL+ftOE9N9aM6kl8XY3Ynubqe8gmqZJlEx9HBOo+R6FLS2O8aEe87pvjCtIDJA6jRTfS+2RjJLTQH8qNfWNg4aP4q5jVXb1OE1L9omYOZlkuagSSmAmy+z245oQVjELabKEHzvJCQ4dbT9LyifVdAcJXxOHGeXjU/y2WY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706712751; c=relaxed/simple; bh=CAVuopFYw2Cq9k4IZHTbz/jUD6sj9hYEe12XppGE8tk=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=MnOxWf5bZGT8ADzbWJwTLQk/XqKDb12vzqSEM2Gohxkj7LR47Yo7MyFAsKWSqggoV987bQRLfd2Qz19zgPaYvweQ5ZiD0MtdjLzPSUjev2ja09ouByAXATP5oIQ2kCOMeULMmzYYDaVhDuxoVG4BRwOkX6PReWQREY1OwX04W4M= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=ZM5My5wo; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id D9202C43601; Wed, 31 Jan 2024 14:52:28 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ZM5My5wo" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1706712747; 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=08V5Tn/E3QHiknxLw9Mvmg79PQM1lmEyJEgFVM+dfA0=; b=ZM5My5woF1RnrEBzh7NrcqN2HvNxx1AExBaNWhqTm2lUemCmQdNGipM8JH9pThNLq7da16 Ds4ggg+Q5amSpO0B9NQviIIWB9XJAC9hMytXOFyoNoLwP7JUVgqXDQudQK769svE+IqIhf VSfCOqaSPVBWKuBUK49CbbmqzMtSCVI= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 6f61bf04 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 31 Jan 2024 14:52:27 +0000 (UTC) Date: Wed, 31 Jan 2024 15:52:26 +0100 From: "Jason A. Donenfeld" To: Theodore Ts'o Cc: "Reshetova, Elena" , "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen , "H. Peter Anvin" , "x86@kernel.org" , 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: <20240131140756.GB2356784@mit.edu> 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 In-Reply-To: On Wed, Jan 31, 2024 at 03:45:06PM +0100, Jason A. Donenfeld wrote: > On Wed, Jan 31, 2024 at 09:07:56AM -0500, Theodore Ts'o wrote: > > What about simply treating boot-time initialization of the /dev/random > > state as special. That is, on x86, if the hardware promises that > > RDSEED or RDRAND is available, we use them to initialization our RNG > > state at boot. On bare metal, there can't be anyone else trying to > > exhaust the on-chip RNG's entropy supply, so if RDSEED or RDRAND > > aren't working available --- panic, since the hardware is clearly > > busted. > > This is the first thing I suggested here: https://lore.kernel.org/all/CAHmME9qsfOdOEHHw_MOBmt6YAtncbbqP9LPK2dRjuOp1CrHzRA@mail.gmail.com/ > > But Elena found this dissatisfying because we still can't guarantee new > material later. > > > On a guest OS, if confidential compute is enabled, and if RDSEED and > > RDRAND don't work after N retries, and we know CC is enabled, panic, > > since the kernel can't provide the promised security gaurantees, and > > the CC developers and users are cordially invited to sharpen their > > pitchforks and to send their tender regards to the Intel RNG > > engineers. > > Yea, maybe bubbling the RDRAND DoS up to another DoS in the CoCo case is > a good tradeoff that will produce the right pitchforkers without > breaking anything real. One problem, though, is userspace can DoS the kernel's use of RDRAND. So probably infinitely retrying in CoCo environments is better than panicing/warning, since ostensibly a kthread will eventually succeed. Maybe, though, the Intel platform just simply isn't ready for CoCo, and marketing got a little bit ahead of the tech? Jason