Received: by 2002:a05:6a10:22f:0:0:0:0 with SMTP id 15csp795687pxk; Thu, 1 Oct 2020 14:08:55 -0700 (PDT) X-Google-Smtp-Source: ABdhPJw60mUyVZs4YyUkgr9uBe3v+lExOVACJlvSkzn3ACEembGKriR6GCD521vyZ1pZBnyf8YS2 X-Received: by 2002:a17:906:4ecb:: with SMTP id i11mr10290154ejv.387.1601586535400; Thu, 01 Oct 2020 14:08:55 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1601586535; cv=none; d=google.com; s=arc-20160816; b=teT7tFIcX4IxdSm1tNrlP/B7rpkWAL7GYrVbPVBvaZDFGwOTF4+O/R/vPlgIEXpwiw 952izDYpGrDBkvcojTR3PlxHpfsufOd5LQNEdEi5P3LafMPPRUryXgkxIReAv9p0hNad BuFwlgGiGQg83f1M/0P8UMWtj5IPh81v44I4KjowsIjRhm5r2O4yLDOcPrCKLKz0LSk6 3Xo3VpZUZgSP5aBUB0LQG67bUexHILpwo08FCssjAlLyBVlmUmpI2CaiZDINOmBJOods Xds44J4f+7uPNQmbvMlK8X0euJspBRzDVzOsKktHKzeqopwVQLRGgHUbzJTSiq1RQn34 vLPw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature; bh=ItqIz6gXnh77/Vt2ZHDHcdf0vLA3J3R86d0HFs2hxss=; b=QaAY0INMV05ziXIyoOqkT2HLIHeFvkuvQc7QCDKqRo143vBwBrhlV0p438l9BP5NNY G/bNm8HXIeBXQ8ltm7bZ3R859+qYf7b4kZv9kLd11eurMFu36B45MM84wwiSyiGZexQW /8cShfnd7u/Ixr5bKDwXelhZav5DG9DFMVNgJNZiX23RiS89/lTowmpO5A9ITMR027wl ocgE/MjsnfcW0LrjGxl+p0CNurCsIgF9DUSTdoTWWoaZRf7op1sRNnQKUP6NLE1BVlPQ ZYWXe6/3tiToXsO9AqlkJJ67JBw4YWA5ynpcg9OMbVqwtomMVSnoZKgNGwUfpMq+lPR5 48oQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ebxxJDPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id dt2si4206097ejc.630.2020.10.01.14.08.32; Thu, 01 Oct 2020 14:08:55 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=ebxxJDPj; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1733120AbgJAVHg (ORCPT + 99 others); Thu, 1 Oct 2020 17:07:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34670 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727017AbgJAVHT (ORCPT ); Thu, 1 Oct 2020 17:07:19 -0400 Received: from mail-pg1-x542.google.com (mail-pg1-x542.google.com [IPv6:2607:f8b0:4864:20::542]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7F1B4C0613D0; Thu, 1 Oct 2020 14:07:19 -0700 (PDT) Received: by mail-pg1-x542.google.com with SMTP id 5so5024307pgf.5; Thu, 01 Oct 2020 14:07:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to; bh=ItqIz6gXnh77/Vt2ZHDHcdf0vLA3J3R86d0HFs2hxss=; b=ebxxJDPj/tvbS24ml8ZXMKFMOcecgfeBF7qk10srMX+oBQ38MoQGwEfoDCkk1XFDTf sMHwM1gF3VedZTaQE1scSLDcdNnRASo/Qt/OsAe4qHLX2g69R+pxwgO9+V3Kv801Bqry 7bUqgK80b8dIuamzcqtslLPYxPEc3ilBAcVtjXgJYuP81z2HLFRwmb+haB7o/FZxj/Jv HSX8ZZuuYhaz8V90/qARmSrZVVqzhqej01C+AzsjRm9uypUkbK25JTjySehoXo8OFJNS zgkoUG0+xc9TaUar/mt8YRhTN/LTGiEmSBB3yHTDB5hukDtq1vapCLXKgbTBLoWD2Yeg p8/A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to; bh=ItqIz6gXnh77/Vt2ZHDHcdf0vLA3J3R86d0HFs2hxss=; b=UGYxKwuhnxkgP5K9s6Mcj7R9Xr5vHOBY+Nl6u7AqeZ/3mPbXjjeWcZprc1LtpEeCHn GbTrizuJ8RRbTDff9UfLzQ9j++iEPVqXsWAjvYAKU7Pths6SDYmZGMClOGYKnRg+k+vc pn4hBfvJpNuEcbjTPq0L2sYOeRIAMymq/PNJkDKhgDLp1kZcmU4OUTUirORKyZOUCnhR yfGSaoI5qNZoMoCLNWFRozBPQeH10jaf0B9H7iwK5QUcERZyXyvB9onDG0SDe4+TRuT4 sABwHWxS82nH/RMF9MZqPwICUG/phQze8ZQiwzxgVC+KAvbOZG4tDqM6QgX9lDlgmAXR QFqA== X-Gm-Message-State: AOAM532BAftBXgggC6M8we8vIccB6RCxpF7+7dDl1MWS3iZxeZ3LLOOD XWZfSp/bmseiIrVT26k8q/KWJyyvGmwM5Q== X-Received: by 2002:a63:161e:: with SMTP id w30mr7496776pgl.255.1601586438657; Thu, 01 Oct 2020 14:07:18 -0700 (PDT) Received: from ubuntu-m3-large-x86 ([2604:1380:45e1:2200::1]) by smtp.gmail.com with ESMTPSA id 14sm724389pjn.48.2020.10.01.14.07.17 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 01 Oct 2020 14:07:17 -0700 (PDT) Date: Thu, 1 Oct 2020 14:07:16 -0700 From: Nathan Chancellor To: Ard Biesheuvel Cc: Lenny Szubowicz , Linux Kernel Mailing List , linux-efi , platform-driver-x86@vger.kernel.org, linux-security-module@vger.kernel.org, andy.shevchenko@gmail.com, James Morris , serge@hallyn.com, Kees Cook , Mimi Zohar , Borislav Petkov , Peter Jones , David Howells , prarit@redhat.com Subject: Re: [PATCH V2 1/3] efi: Support for MOK variable config table Message-ID: <20201001210716.GA3767489@ubuntu-m3-large-x86> References: <20200905013107.10457-1-lszubowi@redhat.com> <20200905013107.10457-2-lszubowi@redhat.com> <20201001174436.GA2622286@ubuntu-m3-large-x86> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, Oct 01, 2020 at 10:57:07PM +0200, Ard Biesheuvel wrote: > On Thu, 1 Oct 2020 at 19:44, Nathan Chancellor wrote: > > > > On Fri, Sep 04, 2020 at 09:31:05PM -0400, Lenny Szubowicz wrote: > > > Because of system-specific EFI firmware limitations, EFI volatile > > > variables may not be capable of holding the required contents of > > > the Machine Owner Key (MOK) certificate store when the certificate > > > list grows above some size. Therefore, an EFI boot loader may pass > > > the MOK certs via a EFI configuration table created specifically for > > > this purpose to avoid this firmware limitation. > > > > > > An EFI configuration table is a much more primitive mechanism > > > compared to EFI variables and is well suited for one-way passage > > > of static information from a pre-OS environment to the kernel. > > > > > > This patch adds initial kernel support to recognize, parse, > > > and validate the EFI MOK configuration table, where named > > > entries contain the same data that would otherwise be provided > > > in similarly named EFI variables. > > > > > > Additionally, this patch creates a sysfs binary file for each > > > EFI MOK configuration table entry found. These files are read-only > > > to root and are provided for use by user space utilities such as > > > mokutil. > > > > > > A subsequent patch will load MOK certs into the trusted platform > > > key ring using this infrastructure. > > > > > > Signed-off-by: Lenny Szubowicz > > > > I have not seen this reported yet but this breaks arm allyesconfig and > > allmodconfig when CPU_LITTLE_ENDIAN is force selected (because CONFIG_EFI > > will actually be enabled): > > > > $ cat le.config > > CONFIG_CPU_BIG_ENDIAN=n > > > > $ make -skj"$(nproc)" ARCH=arm CROSS_COMPILE=arm-linux-gnueabi- KCONFIG_ALLCONFIG=le.config allyesconfig drivers/firmware/efi/mokvar-table.o > > drivers/firmware/efi/mokvar-table.c: In function 'efi_mokvar_table_init': > > drivers/firmware/efi/mokvar-table.c:139:5: error: implicit declaration of function 'early_memunmap' [-Werror=implicit-function-declaration] > > 139 | early_memunmap(va, map_size); > > | ^~~~~~~~~~~~~~ > > drivers/firmware/efi/mokvar-table.c:148:9: error: implicit declaration of function 'early_memremap' [-Werror=implicit-function-declaration] > > 148 | va = early_memremap(efi.mokvar_table, map_size); > > | ^~~~~~~~~~~~~~ > > drivers/firmware/efi/mokvar-table.c:148:7: warning: assignment to 'void *' from 'int' makes pointer from integer without a cast [-Wint-conversion] > > 148 | va = early_memremap(efi.mokvar_table, map_size); > > | ^ > > cc1: some warnings being treated as errors > > make[4]: *** [scripts/Makefile.build:283: drivers/firmware/efi/mokvar-table.o] Error 1 > > > > Cheers, > > Nathan > > Hi Nathan, > > Does adding > > #include > > to drivers/firmware/efi/mokvar-table.c fix the issue? Indeed, that was much simpler than I thought it would be... If you send or apply a patch, feel free to add: Tested-by: Nathan Chancellor Cheers, Nathan