Received: by 2002:a05:7412:d1aa:b0:fc:a2b0:25d7 with SMTP id ba42csp1647319rdb; Wed, 31 Jan 2024 05:14:56 -0800 (PST) X-Google-Smtp-Source: AGHT+IFzlxXj/kgwdVFAWGUMtWmmU/HfO1Ii6O/tLCwwOxhMu3pbQIQs5S0qcMSD7ykAN1HxdEtz X-Received: by 2002:a17:903:1103:b0:1d9:4143:5fe1 with SMTP id n3-20020a170903110300b001d941435fe1mr222723plh.0.1706706895960; Wed, 31 Jan 2024 05:14:55 -0800 (PST) ARC-Seal: i=2; a=rsa-sha256; t=1706706895; cv=pass; d=google.com; s=arc-20160816; b=XGbQEaTnfZuVQUJXn8s1Ocjw5NhG4mH/vAn9yCjFk/cVhJswY7idj52iWCHcbWMGm+ QSOqd7PykXqAYU4Ctw9AloJMeZPwMCw6vV9Ep+39a74eEH5wyy1/9vfTlvG4xUVvrFxI 2QpsamuZzOQAHOSK3DABUd8hRNBQ78Pyh8A7tGhePjEyokAyJxVdLyLWE1MzewfrvL56 2o6LJ+5ybZ0yrkScKTlc965wSsknS8kRjaeuei/KGWRAfkJ9b5aWp/ZzIjO69E3eBQ8o /+2SlI2JAN+Ekl/H+C6K5Ge1wUoX43oTLJ3SRANujxgvDIqPg2jcjfoqHczcq6CwVy5s ExYQ== 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=JMBL4IgJh6FN7pNaSkp+l1vIL/LpjvsQZz9Cc9BlkHY=; fh=p0WwSJdiVFYvGZgVFxtKAG8Rn479vjzq24A/vddy40I=; b=Z5uQxtafuaLE7CC0DI01Cthv8QLkd4dSI4cVbwZAbyrJNua3VvyMFtZ1Mh0zE/PyKT YE8YVkT60DOX8Y5VZ3jaGlOCA0q/GdDnuAtTDCpmDONmE8WXAoikfQRKvJqG/vsukwN7 WmDPOmy2q1VUFcvJQT3Gz3u5Xi67gAmVBjDYYC1jQiSKoypCN9xMfPJTmlykjMoXAaUP GPyLbyt8T7nV6VlIIU4a3W+LTYLGCcFIq/wou/G0kSBUPKhAAd2zPEbpNPHATPCxWMUi pOsIdNZ+h9BRKQrqVtJtmMrLLMc1afVk5Y9oRJwANfF5dYQwuSdUfmVRmcepKTXcJ3i/ 5NmA==; dara=google.com ARC-Authentication-Results: i=2; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="S/KhLrMc"; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46460-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; AJvYcCVbfG+EutQ7LsIUHDADWzk3ldK9Vo6kchj04XQECSJQOnpTnzHc+ZF+XZOzfpIlK7kfgxe89l5Yp6ezZjf+Qv3PFX/I3maosWSOF80ZYQ== Return-Path: Received: from sv.mirrors.kernel.org (sv.mirrors.kernel.org. [139.178.88.99]) by mx.google.com with ESMTPS id l9-20020a170902f68900b001d9158d0776si2807372plg.84.2024.01.31.05.14.55 for (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 31 Jan 2024 05:14:55 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel+bounces-46460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) client-ip=139.178.88.99; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="S/KhLrMc"; arc=pass (i=1 dkim=pass dkdomain=zx2c4.com); spf=pass (google.com: domain of linux-kernel+bounces-46460-linux.lists.archive=gmail.com@vger.kernel.org designates 139.178.88.99 as permitted sender) smtp.mailfrom="linux-kernel+bounces-46460-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 474B8295CA9 for ; Wed, 31 Jan 2024 13:06:44 +0000 (UTC) Received: from localhost.localdomain (localhost.localdomain [127.0.0.1]) by smtp.subspace.kernel.org (Postfix) with ESMTP id 98D587BAE8; Wed, 31 Jan 2024 13:06:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="S/KhLrMc" 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 6B01A762DD for ; Wed, 31 Jan 2024 13:06: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=1706706391; cv=none; b=loAxNEKoIrKfIJ8PDJOdB0lokiSRA/oBa/LwiwNsnFLzmJs+2djfZXAxYNbUop1GM1GpJjcjZSQytkOgPE1fBeGNdP9VbQxnyUKayiHhC0hO70Oj6jpwDKiYY/hgYwIwW18gb4vQhoo8H1H0iKDru4GB6c1VZsfoxgCq9aqTWWI= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1706706391; c=relaxed/simple; bh=JMBL4IgJh6FN7pNaSkp+l1vIL/LpjvsQZz9Cc9BlkHY=; h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject: To:Cc:Content-Type; b=quDRropcUT0MhYbA+IG35RhEF2LjRuNMMlyRg05AAb/ctO/D2v3wJUGIbfjLVxZCGG0nXBH+QTrdEHQNlfLb0TFLzKcfU8wLkqv2UQBbcFWeW5GQoODpw3hmQQ8W4AMIi/XttRAB0ge+qBFDDYV2WR7IXEjjRJKWZ+gJC8HhYEs= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b=S/KhLrMc; arc=none smtp.client-ip=10.30.226.201 Received: by smtp.kernel.org (Postfix) with ESMTPSA id 93AEEC433F1 for ; Wed, 31 Jan 2024 13:06:30 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="S/KhLrMc" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1706706387; 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=JMBL4IgJh6FN7pNaSkp+l1vIL/LpjvsQZz9Cc9BlkHY=; b=S/KhLrMcZXz9d8cswaZ09ypkUDyHrDczczH0oWxpLRDNdvNYObLxIlqHNHIjQgjnQ5P8lT dsxvdTDHKBXOsv6jqQauHHYPxi8m1VU7OIq71YHvhJ5ZAFb1WT3gIkz3JChTTW5rkR4H0X GmtG2pK6O0UYp4SpoBaJXMrSjCNpCmw= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 390c5f6e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO) for ; Wed, 31 Jan 2024 13:06:26 +0000 (UTC) Received: by mail-yw1-f174.google.com with SMTP id 00721157ae682-603fd31f5c2so7641967b3.0 for ; Wed, 31 Jan 2024 05:06:26 -0800 (PST) X-Gm-Message-State: AOJu0Yy2RdSsBeta+J3lKCa+R8G/dQnVZVgcMo68FH5YMjeBJ/5oWYRh M6vx4fd91TFZpCjxyFNBmd7qFek1xdO0bz8OdRadlkEN6VGTwp6vEvLds20iglUnRSnvmogFg7n 3KV5Gx5i54rCIFF4hdRnxJRqKZao= X-Received: by 2002:a05:690c:d17:b0:5ff:8ab2:89a7 with SMTP id cn23-20020a05690c0d1700b005ff8ab289a7mr2802145ywb.4.1706706385220; Wed, 31 Jan 2024 05:06: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> <20240130083007.1876787-2-kirill.shutemov@linux.intel.com> <88a72370-e300-4bbc-8077-acd1cc831fe7@intel.com> In-Reply-To: From: "Jason A. Donenfeld" Date: Wed, 31 Jan 2024 14:06:13 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH 2/2] x86/random: Issue a warning if RDRAND or RDSEED fails To: "Reshetova, Elena" Cc: =?UTF-8?Q?Daniel_P=2E_Berrang=C3=A9?= , "Hansen, Dave" , "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 9:17=E2=80=AFAM Reshetova, Elena wrote: > This matches both my understanding (I do have cryptography background > and understanding how cryptographic RNGs work) > and official public docs that Intel published on this matter. > Given that the physical entropy source is limited anyhow, and by giving > enough pressure on the whole construction you should be able to > make RDRAND fail because if the intermediate AES-CBC MAC extractor/ > conditioner is not getting its min entropy input rate, it wont > produce a proper seed for AES CTR DRBG. > Of course exact details/numbers can wary between different generations of > Intel DRNG implementation, and the platforms where it is running on, > so be careful to sticking to concrete numbers. Alright, so RDRAND is not reliable. The question for us now is: do we want RDRAND unreliability to translate to another form of unreliability elsewhere, e.g. DoS/infiniteloop/latency/WARN_ON()? Or would it be better to declare the hardware simply broken and ask Intel to fix it? (I don't know the answer to that question.) > That said, I have taken an AR to follow up internally on what can be done > to improve our situation with RDRAND/RDSEED. Specifying this is an interesting question. What exactly might our requirements be for a "non-broken" RDRAND? It seems like we have two basic ones: - One VMX (or host) context can't DoS another one. - Ring 3 can't DoS ring 0. I don't know whether that'd be implemented with context-tied rate limiting or more state or what. But I think, short of just making RDRAND never fail, that's basically what's needed. Jason