Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp571004rwb; Fri, 18 Nov 2022 05:34:59 -0800 (PST) X-Google-Smtp-Source: AA0mqf7yLeMpgMkC1fmCaJvNS69vF3FdkxiFTHcC+9rdxpwEpAOJ3pVnp+C2CF8iCG9TDkvomaRA X-Received: by 2002:a17:902:ec8d:b0:188:7dca:6f41 with SMTP id x13-20020a170902ec8d00b001887dca6f41mr7544095plg.72.1668778499398; Fri, 18 Nov 2022 05:34:59 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668778499; cv=none; d=google.com; s=arc-20160816; b=RrPhokt6pbp4M/4xyY5Rcbmkev8/qI4aqq9y0Z0o3rWwoSYkE5oXdhBK0cyDdomPoC 4Mbl5RrE/hE6xtpF8FbBRypiWj/bgIotjt8bAgKyjIXFOFUx8KXaOnnXuhNQxElNOGuj cwixfmK4fvAd7nGrnPVEDmhQZ1byFEdDy01ZEyZsdO8RJRYOdAgnUBRCe6F4gW6EoZ7t gzFQPDfY32EtKbz850KucA4l44U995A+/zDjhu1CcZg0Ra7eI+KYok/MBWzT6XrPSklA 8FjtlwYEIxjBP0rQVRP5bTntOSn6k4drF+3OuOP6piS343/fnYK/FGCeXP8l93nZYmSp mPjg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:date:subject:cc:to:from:dkim-signature; bh=3Ba13+GXNlXQlY1symDczyowf433BVf2HSRAdnZzlc4=; b=oSio4VCRbDNZ2wP//7YKwchlM8HPcnBaU3OnJs+ZTS0jNszr2ZNYZpDKU5/zJZS2+p IivrgNT61bj0bJygmdLJTxnD6W6MsmiAAd30t2umT0Y+BbzElrp8b8oijQf8ofwhNt2P Sh8PpIio3ty0YL17JFrwOzaVawW2nm8X/pP7XeTKAFQKrv6fIhux9w66WsT9/WJ/g5hW hkhC2iV2fZrtnhpKmCGgFh6iWKgvRRLUf+K8LSbEAVy5oETHsUxQApsv88JoMOufdPl1 NFKhNg6fX+zjm0FWIs7ArZYit4unRQMhekziiRNHsMzPDYm4t3EviSrOYI20cgRdD0NO A7PA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="ng/ljxGR"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id x24-20020a63db58000000b0046b1dabcb34si3800433pgi.765.2022.11.18.05.34.38; Fri, 18 Nov 2022 05:34:59 -0800 (PST) Received-SPF: pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="ng/ljxGR"; spf=pass (google.com: domain of linux-crypto-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-crypto-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=zx2c4.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S242137AbiKRNdw (ORCPT + 99 others); Fri, 18 Nov 2022 08:33:52 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:53020 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S242089AbiKRNcx (ORCPT ); Fri, 18 Nov 2022 08:32:53 -0500 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 1758D8E096; Fri, 18 Nov 2022 05:32:52 -0800 (PST) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dfw.source.kernel.org (Postfix) with ESMTPS id A2FD962523; Fri, 18 Nov 2022 13:32:51 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 544B8C433D6; Fri, 18 Nov 2022 13:32:50 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="ng/ljxGR" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1668778367; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version: content-transfer-encoding:content-transfer-encoding; bh=3Ba13+GXNlXQlY1symDczyowf433BVf2HSRAdnZzlc4=; b=ng/ljxGRlpcuw9DqCA97Oz3sebyeBFvUG8S3UKc3PkFP1PzUXoxGvJRo9kaeKK2JhYdjWm IIgbxvs28YuvF+Nn3POdhmOCZH9LJu3skNDIusTVmq/IC6UBU+bFius9IEkVDTkztbFHh2 GTP3jTX7HfYUb9mkW3YoddC5xzf0r2o= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id b8685e6e (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Fri, 18 Nov 2022 13:32:47 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-efi@vger.kernel.org, linux-crypto@vger.kernel.org, patches@lists.linux.dev, linux-kernel@vger.kernel.org Cc: "Jason A. Donenfeld" Subject: [PATCH v2 0/5] Use EFI variables for random seed Date: Fri, 18 Nov 2022 14:32:34 +0100 Message-Id: <20221118133239.2515648-1-Jason@zx2c4.com> MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-6.8 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS, RCVD_IN_DNSWL_HI,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-crypto@vger.kernel.org EFI has a rather unique benefit that it has access to some limited non-volatile storage, where the kernel can store a random seed. This series wires that up, with EFISTUB reading the seed and passing it to the kernel, and with the kernel writing a new seed when the RNG is initialized. Patches 1 and 2 are to go through Ard's EFI tree, while patches 3, 4, and 5 are to go through my RNG tree. Jason A. Donenfeld (5): efi: vars: prohibit reading random seed variables efi: stub: use random seed from EFI variable random: add back async readiness notifier vsprintf: initialize siphash key using notifier efi: random: refresh non-volatile random seed when RNG is initialized drivers/char/random.c | 20 +++++++++ drivers/firmware/efi/efi.c | 19 +++++++++ drivers/firmware/efi/libstub/random.c | 59 +++++++++++++++++++++------ fs/efivarfs/inode.c | 4 ++ fs/efivarfs/super.c | 3 ++ include/linux/efi.h | 1 + include/linux/random.h | 1 + lib/vsprintf.c | 14 +++---- 8 files changed, 100 insertions(+), 21 deletions(-) -- 2.38.1