Received: by 2002:a05:7412:bbc7:b0:fc:a2b0:25d7 with SMTP id kh7csp934221rdb; Fri, 2 Feb 2024 08:18:31 -0800 (PST) X-Google-Smtp-Source: AGHT+IFmtwet6Rr5rMI6Fb2FSGkjS6Il12/bDSz08TN7qmXx6IWngIwongHX5JzyY6UDxl0+ZNiY X-Received: by 2002:a17:906:31cd:b0:a37:1f87:33b0 with SMTP id f13-20020a17090631cd00b00a371f8733b0mr875408ejf.13.1706890711293; Fri, 02 Feb 2024 08:18:31 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706890711; cv=pass; d=google.com; s=arc-20160816; b=iBklv9/O+zcvBkVRfOfIhNshC/kuJOqKTIMY9Y41Ect4uargxM1CjFwEMXr2sTgFu2 ltN/64GoTBEbVQcoeCgUDHFFhv4KKA7gO8xL5ENjGOx6ZceY79RJQ4g6Wk3+EzYSBH12 3cplaOpXuetbTlc8PCcE09d90oGCHQLHXYAiP1bT93uJEtHjO9WIkBloI5q1oOSKBNI/ HHP3QGvTPK254x+QyrkqZdWvm40b4rKVjj03X8NLgXK60y7R0c8nrQUD+T1VIY1prw3e dJGc6GjVyqxcm5yLgP9k8jVknSZm9unaf+QWHSXpM8zdDgakxY/7GmpBw8FWB5nIzEXi sRtg== 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=YNDwaYqILYROFbZ2T7wdnv8w+SAS5ZpbU073hZkeTiI=; fh=V6X1nILWt94hRgWSY77J8d0PZKMNfnABdGQOvKjJh2g=; b=utcJpGQrIShI1FwVN9tQ0DobEegepau5z9ehASkVGF7YbKWe+8fy9yQEd3Qm7H50+2 T8Bc56oZ4NRG8ka0v/S92pfVS3CNUDfQdHFMUb8JqFqPhTovAGzE0uQgZpZ98MjcsZ7l KxF2mBtBWFgS7jaLq7xoLMgdJYGPw/nGfMKqVbdaRrCwXfxPukacY1Il46PE8kSDu6XB xUF0MnqrNvP7lmmQI+tsHLJhZdPzeuDzDUG3Z8MvGo2jy3h0lJl82ytw7GIizZ77yrBO +jQP8uxsE0Pcv72mRwUEUNJBQ0P3YzUkq28PyClfhg0Z4yASyjYhYr51uJRLqUkqoUmf 5p6g==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@mit.edu header.s=outgoing header.b=XXcPMMbC; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-kernel+bounces-50096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu X-Forwarded-Encrypted: i=1; AJvYcCW/hNLnodp4kTM161SGEGRt79GpQZb3iHQ709m9ZB3O6uT0THXd4iL7yE2xsky0KVExf8hOjoeuRncJvZ2vVEp7l58xa1rb2ehWc0SOgA== Return-Path: Received: from am.mirrors.kernel.org (am.mirrors.kernel.org. [147.75.80.249]) by mx.google.com with ESMTPS id v19-20020a17090606d300b00a3614191530si984913ejb.887.2024.02.02.08.18.31 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 02 Feb 2024 08:18:31 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-50096-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=@mit.edu header.s=outgoing header.b=XXcPMMbC; arc=pass (i=1 spf=pass spfdomain=mit.edu dkim=pass dkdomain=mit.edu dmarc=pass fromdomain=mit.edu); spf=pass (google.com: domain of linux-kernel+bounces-50096-linux.lists.archive=gmail.com@vger.kernel.org designates 147.75.80.249 as permitted sender) smtp.mailfrom="linux-kernel+bounces-50096-linux.lists.archive=gmail.com@vger.kernel.org"; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=mit.edu 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 0C1DA1F247AD for ; Fri, 2 Feb 2024 16:09:15 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 6942114A4FF; Fri, 2 Feb 2024 16:06:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="XXcPMMbC" Received: from outgoing.mit.edu (outgoing-auth-1.mit.edu [18.9.28.11]) (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 DA28314A4D4 for ; Fri, 2 Feb 2024 16:06:26 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=18.9.28.11 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889988; cv=none; b=Yi1fpGms9kLnCPAPPsclOHG1UPuoSLg4a2q/9DcluujS8cpaFC5s98f2lcZOG/Xt3RQGj/l75ni9CQ7lFjKQZzdzV8seJe4gC3+Z1Z9FKNl/WPqEQJ7kjHlwIui+x7DtNyFwbsT04qrBlAYIKvqhztoMlczUToM7Dr9FSiTVqZU= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706889988; c=relaxed/simple; bh=Dvndydm0WQiAr8SlU79W28MqK5iSck9hcErAZtsmIyY=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=hJX7CaKS4YVkQsP3hnAzh2PmO61lssxJwFhp7GpTUzVGn11hM/jF1PZpK4Hh0I4PLf+6AE4lQctI3dZpjwe63c+BNYowi7RXo4kx9M/BKBql0L4W+HmXQ1IDk7FDGRyGGLGmreVrqJ4H0kuV66V2gRpSZapvAZtyvUaMgY59+8E= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu; spf=pass smtp.mailfrom=mit.edu; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b=XXcPMMbC; arc=none smtp.client-ip=18.9.28.11 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=mit.edu Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=mit.edu Received: from cwcc.thunk.org (pool-173-48-116-13.bstnma.fios.verizon.net [173.48.116.13]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 412G5FUn028060 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Fri, 2 Feb 2024 11:05:16 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1706889920; bh=YNDwaYqILYROFbZ2T7wdnv8w+SAS5ZpbU073hZkeTiI=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=XXcPMMbCQXCYHB/LLJaHRJrNlhp80U9c2YRyCNdycadKxv7zueJalMaApizf6gv1t z5l6HH5428VQbFp7BT1GMx3w8iiZIHFaCp+X+FNmjqXFUtrjibjupf6AzfI/+9HS91 Jtr+FgTOtX4Atz4KN4UwZlglm4rZbd5SbAG5DPOYKXLeDa/+ztBh9WD0bY5RvniO2Q Nhk4HXt6Uw5zh1+ZaLrC9b/dO41Er4QHPDGMBGoFBpBduyM1ybZ8IEZ/vCsIVb+Wip jSxLpDJckcw46RAkCyQEb2zfAV+xW2RseHs79eg2+ZoZOpQLNXI43iB+twSQunUJnH Gypz0AcZcNs/A== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 536D015C02FC; Fri, 2 Feb 2024 11:05:15 -0500 (EST) Date: Fri, 2 Feb 2024 11:05:15 -0500 From: "Theodore Ts'o" To: James Bottomley Cc: "Jason A. Donenfeld" , "Reshetova, Elena" , Dave Hansen , "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "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: <20240202160515.GC119530@mit.edu> References: <20240131140756.GB2356784@mit.edu> <20240131171042.GA2371371@mit.edu> <20240201045710.GD2356784@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=us-ascii Content-Disposition: inline In-Reply-To: On Fri, Feb 02, 2024 at 04:47:11PM +0100, James Bottomley wrote: > > It's a lot to quote, so I cut it, but all of your solutions assume a > rdseed/rdrand failure equates to a system one but it really doesn't: in > most systems there are other entropy sources. In confidential > computing it is an issue because we have no other trusted sources. The > problem with picking on rdseed/rdrand is that there are bound to be > older CPUs somewhere that have rng generation bugs that this will > expose. I'm not sure what you're concerned about. As far as I know, all of the CPU's have some variant of Confidential Compute have some kind of RDRAND-like command. And while we're using the term RDRAND, I'd extend this to any CPU architecture-level RNG instruction which can return failure if it is subject to exhaustion attacks. > How about making the failure contingent on the entropy pool > not having any entropy when the first random number is requested? We have tried to avoid characterizing entropy sources as "valid" or "invalid". First of all, it's rarely quite so black-and-white. Something which is vulnerable to someone who can spy on inter-packet arrival times by having a hardware tap between the CPU and the network switch, or a wireless radio right next to the device being attacked, might not be easily carried out by someone who doesn't have local physical access. So we may be measuring various things that might or might not have "entropy". In the case of Confidential Compute, we have declared that none of those other sources constitute "entropy". But that's not a decision that can be made by the computer, or at least until we've tracked the AGI problem. (At which point, we might have other problems --- "I'm sorry, I'm afraid I can't do that.") - Ted