Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp923831rwb; Wed, 16 Nov 2022 09:23:47 -0800 (PST) X-Google-Smtp-Source: AA0mqf6/axoY4rUkJx1cwZpfv9Sk2Q7MUq0WpFB/IUSWoO68uqbJb3vp3lzBHnV9Z8UvouvSLeA3 X-Received: by 2002:a05:6402:f12:b0:467:97e4:6339 with SMTP id i18-20020a0564020f1200b0046797e46339mr15849612eda.381.1668619427428; Wed, 16 Nov 2022 09:23:47 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1668619427; cv=none; d=google.com; s=arc-20160816; b=HRnwS7sLCkgr82zwgWAdUUYDRdre2lNlLe70DbI2EeNJ/SxvNL8SgEEeXNR8+65kzy GAGOlQ7/fLAKeUojotsII88MigeHl+e7gLm/ryEBywvSi0n9DEmosaVk4D4a/uGT/URe 2/UVqsKGUmuu+foeN3mxdycYq9od4+xWRNwidsAzNeLywSJ1kiNlnQi9eeTis9DUlhP1 AFyA7MRA/qN01KSEoYmjiemicDGBxDN0VgHyXcWIhLZOJp8IiErQfmvNJs0UM+ZgrZ8l OAgUQkMteVETcz11lRU0y7ACKfe3JXF+MkL8lVKVvqtjWgg+iqwhrc5cnZGzNJUDFptk 9ILg== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:cc:to:subject:message-id:date:from:in-reply-to :references:mime-version:dkim-signature; bh=1PVD/t+uw3S4N2MVWK1Ix1PItjVG5TsNKSI7A3cxuZA=; b=xZLAFv/fFLk+zvcGJdx28LgFZAaVeKhWeUPE1n0dJFFSNaz3AnX2+u80SL3o5g9GVQ 01kxPSEJQOn2sgfBctbvqu+NyHWrCfi0X2dirEaE0WurYAna1c8sNd4xlQaFlzm3Pqef TTHTTU71ZjnUI2RSc5UKKHZLBuuJnNI+JKkoB3cni7d9yhCXi/JYHeKYnFunMGaKwJ1c axTM2xCCK1n9vvVQeP4aI+nqssWDrHwSlm9B3aAAbBN1RKN+Y8xKFoPpXPukLUfGjuyb RLxe5wDQhAyzpdpDSXj2rb9ehn9vTYI7ubmSmBCMb0RK6JvrkNORcIBYoQws8NwOWEQ0 MQJA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b=tHv2X2k0; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id qa38-20020a17090786a600b007ad9f041c3bsi13637150ejc.27.2022.11.16.09.23.18; Wed, 16 Nov 2022 09:23:47 -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=@kernel.org header.s=k20201202 header.b=tHv2X2k0; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236617AbiKPRGZ (ORCPT + 99 others); Wed, 16 Nov 2022 12:06:25 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50160 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S234873AbiKPRGH (ORCPT ); Wed, 16 Nov 2022 12:06:07 -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 49B9B59863; Wed, 16 Nov 2022 09:05:04 -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 CA7F061EF8; Wed, 16 Nov 2022 17:05:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 28720C433C1; Wed, 16 Nov 2022 17:05:03 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1668618303; bh=H4TU2MseEDfh27pYoEWcB2Ezu9/ASv5smgrOn2XF3tE=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=tHv2X2k0ksEuqCRCseCqNMS9aCodgXOr1vTbqO+CqVMA55fypP+SmYdS6fmGYmoB3 j+zlsb2ipPAZQ0BZda6RYa5RV/IHaXtBF4/UAF1+lfOnyPcO5MzWV7Dk2YcsNz1LkO tCF6eXwYIWgKBFWU6/9KXKNzCVNUHALGHldgZzSahNByveO5dbIWdTfBM0QJrTH1A6 /hNbycj7SWszAYQ1xRq54cOb1nl9qfY36MdTasxqm5yOETtlBjjcBpo8Jv2NGXvay8 g8eG5Mk+pBexlIlvMOh8NcY2RHsPiIggRpyH06T00QIZxO9OZE+I1ivhaRnjOf4wpI zfEaUvNYJAiwQ== Received: by mail-lj1-f181.google.com with SMTP id k19so22636128lji.2; Wed, 16 Nov 2022 09:05:03 -0800 (PST) X-Gm-Message-State: ANoB5plk0lAZrvXbhj+6ukqMbnpqAMOo8qSo3NWK0wpaDnclM4gFN6U7 DEOog0Gw6WGvOT34+HsXPQzmglj9N6NG4vfaci0= X-Received: by 2002:a2e:9593:0:b0:277:2428:3682 with SMTP id w19-20020a2e9593000000b0027724283682mr8713902ljh.291.1668618301194; Wed, 16 Nov 2022 09:05:01 -0800 (PST) MIME-Version: 1.0 References: <20221116161642.1670235-1-Jason@zx2c4.com> <20221116161642.1670235-6-Jason@zx2c4.com> In-Reply-To: <20221116161642.1670235-6-Jason@zx2c4.com> From: Ard Biesheuvel Date: Wed, 16 Nov 2022 18:04:50 +0100 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH RFC v1 5/6] efi: efivarfs: prohibit reading random seed variables To: "Jason A. Donenfeld" Cc: linux-efi@vger.kernel.org, linux-crypto@vger.kernel.org, Lennart Poettering Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.1 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,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 On Wed, 16 Nov 2022 at 17:17, Jason A. Donenfeld wrote: > > 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); > > /* I'd prefer it if we could just disregard them entirely, i.e., never enumerate them so that they don't appear in the file system.