Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp2614673imu; Thu, 17 Jan 2019 18:17:42 -0800 (PST) X-Google-Smtp-Source: ALg8bN6j9C7cpry4NngleAWsKVnU4NNCk/CZ0lFI6UB76CpfOKZTnu6y/FGJ4CptVaTclTc9H3HC X-Received: by 2002:a63:9c1a:: with SMTP id f26mr15879786pge.381.1547777862135; Thu, 17 Jan 2019 18:17:42 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1547777862; cv=none; d=google.com; s=arc-20160816; b=XI0f4116wl2NsNaINh6/wGYlEg7FlRyY//vwVi9eoX458i5WH13x+V+nIQzD31P75t Mg5FIMgBlWFY8AVg9DA2mJsR+zC44bGQXlapJnNejz7zKLOC4EEMDK8z0RI9BP6rf1qs 4N8hirwV0oqu1xr/vmhlL4J2uZ7njf9ZuxkVtOd9I3QxlZiFMHQnnkhS1kZvmpQH8YHo w9iAf385Y1tAdFVyP7me+yMPy8+myuG1JuA2O0QsP2mZA/xWXvW6YfQj0/gDUTR0uLQh 9lY32fwyF+4KlhdCBhGq9wXpKWQHZSXJMvC9BjJxQciMeIrlN8q7ocpV4dCCYw+EYEAM Gq1Q== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version; bh=z1Vi2twaxCAxBYKd/ynqir+tFE92LwhK2OpVcmOSNbw=; b=Kx87Erqen3FRhoMC19PUFIbv9F4a49P+k6trf2CtoqQmTUUSoTGFl4oEOfYfK8r6D0 q/381IrENQe7Dcp5eBP2R69CJ6Sl1uwyslaaWoQEwb1dsdSXGnyxEAJbY0y+xAtTFaf+ c4yjQC8k+VmVOELCEGMGwouaaGM0hPtHHzV8UupAEGkl3O/GTIYN7E9QY7AXDQYsIs8O tyGRPV+3O1SO621J18ZdxNLf03iPG8N7JR7oK1eoc9Y/yrY10VKypeWk83+WZ6Uv9O0K 1weEiRgw55ChrzpzAze1DpExSoHav3ELGdrkyAfQ/5QgL0NDmAe4deFIc1ju89za8Vg3 5smA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t3si3330888pgl.108.2019.01.17.18.17.25; Thu, 17 Jan 2019 18:17:42 -0800 (PST) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727078AbfARCQQ (ORCPT + 99 others); Thu, 17 Jan 2019 21:16:16 -0500 Received: from mail-io1-f67.google.com ([209.85.166.67]:41218 "EHLO mail-io1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726821AbfARCQQ (ORCPT ); Thu, 17 Jan 2019 21:16:16 -0500 Received: by mail-io1-f67.google.com with SMTP id s22so9503310ioc.8 for ; Thu, 17 Jan 2019 18:16:15 -0800 (PST) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=z1Vi2twaxCAxBYKd/ynqir+tFE92LwhK2OpVcmOSNbw=; b=USIb9LvlLAQPFBM3B40cawVZTrBQH/GZuAzeoGqPfs53v3wvn/AbdeacLS/eVzilGl Vnw8FEXedznMATxSvSrtwOHFSUL0cLuKJ256q2IpVfd9e7MvqCfKetFwOwBawfJBaxh+ ybF8VCJ0VYB679D1kCRF3KuS1Dgj8oX1yiZA/PFPWRwxhStJEWaUIw56y6749lHwntbj SAVXzAjEUE+UGeCokRMDduJk6p0FIhyylV2rCHCT0zAL2MtzfliLatj0zbNtVVL4NSsK 7b1xvY0F8Kizai47Mrz1p4IBxqcukLmjLFIkjM2d1WGywOsjC3lh5EsiKx+uB0jpM+hN NL3A== X-Gm-Message-State: AJcUukdmEDUP2GyGxzYGTGjPtrIycimNnsR4IuOYMosYV9rsTWjnVWax g57wdDWEh18K0xpl3Gujv3q408EuxaKeD7ahM04tNw== X-Received: by 2002:a6b:b502:: with SMTP id e2mr8494488iof.43.1547777775146; Thu, 17 Jan 2019 18:16:15 -0800 (PST) MIME-Version: 1.0 References: <20190116101654.7288-1-kasong@redhat.com> <1547773684.4026.10.camel@linux.ibm.com> <20190118013530.GA2814@dhcp-128-65.nay.redhat.com> <20190118020006.GB2814@dhcp-128-65.nay.redhat.com> In-Reply-To: <20190118020006.GB2814@dhcp-128-65.nay.redhat.com> From: Kairui Song Date: Fri, 18 Jan 2019 10:16:04 +0800 Message-ID: Subject: Re: [PATCH v3 0/2] let kexec_file_load use platform keyring to verify the kernel image To: Dave Young Cc: Mimi Zohar , linux-kernel@vger.kernel.org, David Howells , David Woodhouse , jwboyer@fedoraproject.org, keyrings@vger.kernel.org, jmorris@namei.org, serge@hallyn.com, bauerman@linux.ibm.com, Eric Biggers , nayna@linux.ibm.com, linux-integrity , kexec@lists.infradead.org Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Fri, Jan 18, 2019 at 10:00 AM Dave Young wrote: > > On 01/18/19 at 09:35am, Dave Young wrote: > > On 01/17/19 at 08:08pm, Mimi Zohar wrote: > > > On Wed, 2019-01-16 at 18:16 +0800, Kairui Song wrote: > > > > This patch series adds a .platform_trusted_keys in system_keyring as the > > > > reference to .platform keyring in integrity subsystem, when platform > > > > keyring is being initialized it will be updated. So other component could > > > > use this keyring as well. > > > > > > Remove "other component could use ...". > > > > > > > > This patch series also let kexec_file_load use platform keyring as fall > > > > back if it failed to verify the image against secondary keyring, make it > > > > possible to load kernel signed by third part key if third party key is > > > > imported in the firmware. > > > > > > This is the only reason for these patches. Please remove "also". > > > > > > > > > > > After this patch kexec_file_load will be able to verify a signed PE > > > > bzImage using keys in platform keyring. > > > > > > > > Tested in a VM with locally signed kernel with pesign and imported the > > > > cert to EFI's MokList variable. > > > > > > It's taken so long for me to review/test this patch set due to a > > > regression in sanity_check_segment_list(), introduced somewhere > > > between 4.20 and 5.0.0-rc1. The sgement overlap test - "if ((mend > > > > pstart) && (mstart < pend))" - fails, returning a -EINVAL. > > > > > > Is anyone else seeing this? > > > > Mimi, should be this issue? I have sent a fix for that. > > https://lore.kernel.org/lkml/20181228011247.GA9999@dhcp-128-65.nay.redhat.com/ > > Hi, Kairui, I think you should know this while working on this series, > It is good to mention the test dependency in cover letter so that reviewers > can save time. > > BTW, Boris took it in tip already: > https://git.kernel.org/pub/scm/linux/kernel/git/tip/tip.git/commit/?id=993a110319a4a60aadbd02f6defdebe048f7773b > Hi, thanks for the suggestion, I did apply your patch to avoid the failure. Will add such info next time. Will send out V4 and update commit message as suggested by Mimi -- Best Regards, Kairui Song