Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp845333rwb; Wed, 16 Nov 2022 08:22:35 -0800 (PST) X-Google-Smtp-Source: AA0mqf4oqoWj4oJAZJR0vgvSOB64VRYrp5B48an8Fz6Moo+Y59iV+MV2wWMkwyxCLCwue5vV8RU4 X-Received: by 2002:a17:907:a701:b0:78d:9858:e538 with SMTP id vw1-20020a170907a70100b0078d9858e538mr18916505ejc.502.1668615754943; Wed, 16 Nov 2022 08:22:34 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668615754; cv=none; d=google.com; s=arc-20160816; b=yyIPoHhO3CYKnXUmVMKCdvM9oExoF29ca/HJU9SwQ77KsixmiA2Eu8cF1sCoHgqCwD N79ZHVIcVrQiYkzX+/AIljyrrXPIhToc1ABlb9tr5njtrdCTXCfBYyzpNJ4jsCTw7m4U F9muaERHTnEp/o0yBaqen+qQDhO1i2WEWhjBEdIcw5Lsm85Nr1a+E1eckK6YOJZIF03f WMaPBmoEif2lM/d7+8LTYyO4KyEZXowePogULYbT4nhqad/JsRWrmM8r+5U8mAtD6KPf pj6ICBDy7ae8qvjqVxCYxzxSCzhR8lgBmEHV2Bvt5MEzahUW5zQfoaGwkkQOWJ6B35ZN SSQg== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=SutN9URRaDRkoRI4sfbAAJPIQ0pLYtrJHZUE/tUAx5Q=; b=Vi2yuQkG3U+uPRHsuJqVJd6GVsPOfihOO4gFVC7vH3Y9iTb3+rlKz1fPHne+i9aDT5 s0f5A7qfnm5esY8qAOzS6isiTJZ0BKds34sgCTLptv6LmV7xkoR82eb3s7kICo05NA73 S2QU2Ih9/xzu9B73su8f3XmzUwGj9OepO0AE/qy9O5/VQk70gaEQna0MYfu8yU18NL7O RJPnWT+NotRblQB81Mzh4S90zd4fpWnY8JmttzQhvYGCYLHEs34MxxdXwdRltxLTxIvJ 9JvbeRZFiIrF+mWkrh5zwEe98bka9PuZzzkeZizoVhLesM2bScREjwI6DCmsFhgIU5o+ b7bA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@zx2c4.com header.s=20210105 header.b="DO7/xtKp"; 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 k4-20020a1709063e0400b0078d4ba46622si12490812eji.616.2022.11.16.08.22.11; Wed, 16 Nov 2022 08:22:34 -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="DO7/xtKp"; 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 S234223AbiKPQRV (ORCPT + 99 others); Wed, 16 Nov 2022 11:17:21 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54268 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S238085AbiKPQRR (ORCPT ); Wed, 16 Nov 2022 11:17:17 -0500 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 8514BD135; Wed, 16 Nov 2022 08:17:16 -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 ams.source.kernel.org (Postfix) with ESMTPS id 42997B81DD9; Wed, 16 Nov 2022 16:17:15 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5CD32C433D6; Wed, 16 Nov 2022 16:17:13 +0000 (UTC) Authentication-Results: smtp.kernel.org; dkim=pass (1024-bit key) header.d=zx2c4.com header.i=@zx2c4.com header.b="DO7/xtKp" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=zx2c4.com; s=20210105; t=1668615433; 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: in-reply-to:in-reply-to:references:references; bh=SutN9URRaDRkoRI4sfbAAJPIQ0pLYtrJHZUE/tUAx5Q=; b=DO7/xtKpmJ+qbHUkvjOiJl95LOYlJrLNXrCH1BXJ5r/WuFITUd9HEjZ/RqdSLzoGooTmYc gfHssY9a8mQGQCUu90xJOpKx3QeILTHlt5an1KxtzQ2WBAcZ4bsfucAykgwEOaq44uGweW bOC9xpFA89pnO1UW3k8kh5xasxnPH/E= Received: by mail.zx2c4.com (ZX2C4 Mail Server) with ESMTPSA id 8e977426 (TLSv1.3:TLS_AES_256_GCM_SHA384:256:NO); Wed, 16 Nov 2022 16:17:12 +0000 (UTC) From: "Jason A. Donenfeld" To: linux-efi@vger.kernel.org, linux-crypto@vger.kernel.org Cc: "Jason A. Donenfeld" , Ard Biesheuvel , Lennart Poettering Subject: [PATCH RFC v1 5/6] efi: efivarfs: prohibit reading random seed variables Date: Wed, 16 Nov 2022 17:16:41 +0100 Message-Id: <20221116161642.1670235-6-Jason@zx2c4.com> In-Reply-To: <20221116161642.1670235-1-Jason@zx2c4.com> References: <20221116161642.1670235-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 Variables in the random seed GUID must remain secret, so deny all reads to them. Signed-off-by: Jason A. Donenfeld --- fs/efivarfs/file.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/fs/efivarfs/file.c b/fs/efivarfs/file.c index d57ee15874f9..08996ba3a373 100644 --- a/fs/efivarfs/file.c +++ b/fs/efivarfs/file.c @@ -76,6 +76,9 @@ static ssize_t efivarfs_file_read(struct file *file, char __user *userbuf, while (!__ratelimit(&file->f_cred->user->ratelimit)) msleep(50); + if (guid_equal(&var->var.VendorGuid, &LINUX_EFI_RANDOM_SEED_TABLE_GUID)) + return -EPERM; + err = efivar_entry_size(var, &datasize); /* -- 2.38.1