Received: by 2002:a6b:fb09:0:0:0:0:0 with SMTP id h9csp4208634iog; Tue, 21 Jun 2022 14:34:31 -0700 (PDT) X-Google-Smtp-Source: AGRyM1t+Ov4mWZUUkAmkFBSxULBc/KykA118nhViUlNP5NYsBH228d7Hy03XgESRDVBPRPsgSg4C X-Received: by 2002:a17:902:a60a:b0:168:b5f7:4148 with SMTP id u10-20020a170902a60a00b00168b5f74148mr31296098plq.47.1655847271148; Tue, 21 Jun 2022 14:34:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1655847271; cv=none; d=google.com; s=arc-20160816; b=cKPWHIOCKsJLoWqKZZ4qXoPTmyZT3wwgtvqzZSfgmQpXzE7CHspfXJfEPOHe80YZ1I ki7/68q1SYSof2FzjZncMht7wdx1PBwNNv64bHDgUmbEfG2cZN1C/Vn8iwIEQo9jXmi/ p5LpIsmoaP+sVlymx51r7DrGttuQN5GtWI2Mh9dPhpTyJNW61z8FgMtInXdgSo3lfyJF IPPLaze5fOlMZDMyo4WurcowE2Fakk0x71PulUlenUTjNKFi8iik/or5f5Ab8r4rLaIq l8DmEMGC8sab+TldK/u8G6Vyy4npTjjdsXJ19grGQZcMTNNvSgt6LFySxGO2JM8QJPPB vzRA== 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=nUYoRoex6w347HOwhaDxEO5t5c8d600lKv1dhQIfL5c=; b=OJBxBV3RVI/GBDSdafve2RdT/yX+AQUTmamW130dq8XqKkjLew745hxR/IlCxbC3bP swFX1vCBcgv4179ZctCxpPUQhYSHn4FhyLMyyFIPaP5BdXjVaDi4TubQPq8mr+aMPjHS GY47NPu5eXJoJiOlwTJVo0wIGMJOWJiumf7DnUTz6VVOdo01ETGdCNYxUNatjpObNR1g z0AaagQA4UvLmwcGVAYaO8vDzqoSfVh6Ynm6PerEzKP1wXBdcKM53de8fzg2xgHsqTB8 TOxAnMe/XcFAQ/Dz9anD21u8w5HswJIEPwwrppBCcBBAebs8nX/0PoWa89jxYzY3cmKL lnvw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="ZbGRF/Y8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 h10-20020a65404a000000b003db8bb45f56si20652016pgp.104.2022.06.21.14.34.19; Tue, 21 Jun 2022 14:34:31 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-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="ZbGRF/Y8"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-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 S1355459AbiFUVXG (ORCPT + 99 others); Tue, 21 Jun 2022 17:23:06 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:37576 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355464AbiFUVWi (ORCPT ); Tue, 21 Jun 2022 17:22:38 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F0F7562F6; Tue, 21 Jun 2022 14:12:29 -0700 (PDT) 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 8EA076155D; Tue, 21 Jun 2022 21:12:29 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EEDD8C341C4; Tue, 21 Jun 2022 21:12:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1655845949; bh=nUYoRoex6w347HOwhaDxEO5t5c8d600lKv1dhQIfL5c=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=ZbGRF/Y8Bn6KTBDQOCtPqsTiGZyLokKfBISfZJAG4yobQaKFvMV2Jck7Uyz14tUjw W8SqMmRA/nqwnxrLPI1ASP0cBWkpUiVPCCXGoacD3d8Gis5eI4FjMH0jwDHal4aVij gP7XFSac0HWyOg3tfsyz1dhmDLd6A4xiWC2Jwj6b1eOGWI+W5At3H/KYWL/+Mdqm6z joY8UCbXj+v+fA2B0n27l/cB0SFv4tZ6LkJsnWgTTc0sgqKPmbz9QQLOeR5TrWuxkz xrleY2ClSfYSEwyGccRtNLpEijg4US7s9tyzibRACrGJxdjxdpL8hzhL/GNhiNBWLo ERboSqUl81VjQ== Received: by mail-oa1-f43.google.com with SMTP id 586e51a60fabf-101d2e81bceso11180349fac.0; Tue, 21 Jun 2022 14:12:28 -0700 (PDT) X-Gm-Message-State: AJIora/yKFWUcduipDUo75V7CaCU9oPGBjW6m+y92yubfZ2KZQPSqWBC EgKGkIsdBx2AZghFOu6E1DAtREHgS1uiYlJD5Yg= X-Received: by 2002:a05:6870:d587:b0:101:dfd4:4cfa with SMTP id u7-20020a056870d58700b00101dfd44cfamr41237oao.126.1655845948158; Tue, 21 Jun 2022 14:12:28 -0700 (PDT) MIME-Version: 1.0 References: <20220621153623.3786960-1-ardb@kernel.org> <20220621153623.3786960-5-ardb@kernel.org> <202206211357.C66CD742E5@keescook> In-Reply-To: <202206211357.C66CD742E5@keescook> From: Ard Biesheuvel Date: Tue, 21 Jun 2022 23:12:17 +0200 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [PATCH v2 4/9] efi: pstore: Omit efivars caching EFI varstore access layer To: Kees Cook Cc: linux-efi , Linux Kernel Mailing List , Matthew Garrett , Peter Jones , Tony Luck , Thomas Gleixner , Ingo Molnar , Borislav Petkov , Dave Hansen Content-Type: text/plain; charset="UTF-8" X-Spam-Status: No, score=-7.7 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,T_SCC_BODY_TEXT_LINE 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-kernel@vger.kernel.org On Tue, 21 Jun 2022 at 23:00, Kees Cook wrote: > > On Tue, Jun 21, 2022 at 05:36:18PM +0200, Ard Biesheuvel wrote: > > Avoid the efivars layer and simply call the newly introduced EFI > > varstore helpers instead. This simplifies the code substantially, and > > also allows us to remove some hacks in the shared efivars layer that > > were added for efi-pstore specifically. > > > > Since we don't store the name of the associated EFI variable into each > > pstore record when enumerating them, we have to guess the variable name > > it was constructed from at deletion time, since we no longer keep a > > shadow copy of the variable store. To make this a bit more exact, store > > the CRC-32 of the ASCII name into the pstore record's ECC region so we > > can use it later to make an educated guess regarding the name of the EFI > > variable. > > I wonder if pstore_record should have a "private" field for backends to > use? That seems like it solve the need for overloading the ecc field, > and allow for arbitrarily more information to be stored (i.e. store full > efi var name instead of an easily-colliding crc32?) > We could easily add that - we'd just have to decide how to free the memory it points to.