From mboxrd@z Thu Jan 1 00:00:00 1970 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 D62F513DB9F for ; Wed, 14 Feb 2024 20:11:38 +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=1707941500; cv=none; b=BaJEKeGrcCnLu8jojeN4mt+09gV3GECbBBWxIDz0NKoGo3Yy7OUa9oQWUzJXvGR+cdUUnp3JObq4Nmlv4aGWl38730nq8/KkAHBv4Iedcl9mFaLOxvQxP7o1YVfMnpR5NzP2sX2TL1C4gfpnV4G3/PbI9gdSV8KOxHfcEPTZPfk= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1707941500; c=relaxed/simple; bh=/ZuOsvm+ugjogtnQYauwuHlqII7gJDAvZenPphyeOTg=; h=Date:From:To:Cc:Subject:Message-ID:References:MIME-Version: Content-Type:Content-Disposition:In-Reply-To; b=qMwN4Yx/Dfx4EBmG7MO5m4qiaXCv2KwNoYa4VBZNcDfm8UKG1L2r5PSD/S995XQnb3BMRRghlp02v6Wwcz+3DvEfyj7XgeMsT+D7JJjW/YmWU15gaOFLB1SGbcEY7C7jHs2WgXL9o19x5kjPScWdJ80YjeUErJ6DHb9/w3W6pX0= 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=HYafmwXJ; 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 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=mit.edu header.i=@mit.edu header.b="HYafmwXJ" Received: from cwcc.thunk.org (pool-173-48-116-68.bstnma.fios.verizon.net [173.48.116.68]) (authenticated bits=0) (User authenticated as tytso@ATHENA.MIT.EDU) by outgoing.mit.edu (8.14.7/8.12.4) with ESMTP id 41EKB3RJ014249 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Wed, 14 Feb 2024 15:11:04 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=mit.edu; s=outgoing; t=1707941467; bh=k5ul52OyszAycDp6xjgdUU0Nu7SKg7gxDb+aIqrDSBI=; h=Date:From:Subject:Message-ID:MIME-Version:Content-Type; b=HYafmwXJAanqRV3F6Jate0WgDdcDRPu0pIFja/hMZ28tgviDD++OMeLTNtgf+HDeJ g41VJSsjje70O+TtSvGgQ1OSBx0m2oWKYO9Pf147HSWu8t/LzCc/VTYuiA2tGhtM5+ HAbM079BjsaAfsog53B8U6O4ErXO7m75oiUv44cp0AvzWnXAsjqEqR+BI780qHpxAS fBVDGT5UyKrSY7oqLRogQ/O/0Ioj1F/fCdhgbnW+wq/PuZghACzy7WhxoChc9lN2Kg SIfQ4QOxdbsRv/dPGk8nzqjSzvup36ekL7oeNGK53dE4mC9arYgTApphkJNhJWOm00 iq+wXxg2vW8Ug== Received: by cwcc.thunk.org (Postfix, from userid 15806) id 755B615C0336; Wed, 14 Feb 2024 15:11:03 -0500 (EST) Date: Wed, 14 Feb 2024 15:11:03 -0500 From: "Theodore Ts'o" To: "Jason A. Donenfeld" Cc: Tom Lendacky , "Reshetova, Elena" , Borislav Petkov , Dave Hansen , "Kirill A. Shutemov" , Thomas Gleixner , Ingo Molnar , "H. Peter Anvin" , "x86@kernel.org" , Kuppuswamy Sathyanarayanan , "Nakajima, Jun" , "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: <20240214201103.GD394352@mit.edu> References: <20240131171042.GA2371371@mit.edu> <20240201045710.GD2356784@mit.edu> <696a5d98-b6a2-43aa-b259-fd85f68a5707@amd.com> Precedence: bulk X-Mailing-List: linux-coco@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: On Wed, Feb 14, 2024 at 09:04:34PM +0100, Jason A. Donenfeld wrote: > AMD people, Intel people: what are the fullest statements we can rely > on here? Do the following two statements work? > > 1) On newer chips, RDRAND never fails. > 2) On older chips, RDRAND never fails if you try 10 times in a loop, > unless you consider host->guest attacks, which we're not, because CoCo > is only a thing on the newer chips. > > If those hold true, then the course of action would be to just add a > WARN_ON(!ok) but keep the loop as-is. I think we may only want to do the WARN_ON in early boot. Otherwise, on older chips, if a userspace process executes RDRAND is a tight loop, it might cause the WARN_ON to trigger, which is considered undesirable (and is certainly going to be something that could result in a syzbot complaint). - Ted