From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from bombadil.infradead.org (bombadil.infradead.org [198.137.202.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.lore.kernel.org (Postfix) with ESMTPS id CE8BDC433F5 for ; Wed, 13 Apr 2022 09:36:38 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:Content-Type: Content-Transfer-Encoding:List-Subscribe:List-Help:List-Post:List-Archive: List-Unsubscribe:List-Id:In-Reply-To:MIME-Version:References:Message-ID: Subject:Cc:To:From:Date:Reply-To:Content-ID:Content-Description:Resent-Date: Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Owner; bh=EUmrsdVDqST2Fihd7EUk4a7s/ateq90sWm0ZgTkY/GI=; b=rMAIWZb4SFccr+0pipS1zN+JLz vr7bSxSGKKQDJh8BJK5ICjcu7u+KDwgBaLD9crZb23dZG76GIUeGb7utRL6uJxfqpr5d3lBNS8bvy P8vRddrxM3xtPxlzf/zXv+lke01PaH5CZcY4vg43MZU9np+TmgsSrOIoqgGnuKqkyOXaXgZ+IEg9h 1rgkP71h592IiPfbhVSZe7vkABFySAXcQpzQE8QYPQlvLSsdvvZ8YulJUPCWVx6gJQ4fsf7yQ/sek 5bBhDTIwxkK4HRENiUqYenh+egnXu0ZEHBphFkW2+oqn/ItnHTVASZLQ2IjBhOQDjLruFeIJBTKmj 9zx/D/gw==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1neZPV-000Lp4-5u; Wed, 13 Apr 2022 09:35:37 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.129.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1neZPR-000LmY-TB for linux-arm-kernel@lists.infradead.org; Wed, 13 Apr 2022 09:35:35 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1649842531; h=from:from:reply-to:subject:subject:date:date:message-id:message-id: to:to:cc:cc:mime-version:mime-version:content-type:content-type: content-transfer-encoding:content-transfer-encoding: in-reply-to:in-reply-to:references:references; bh=UTiCvYTnTb41Mgsrx3d1OeSZQnQmS6cYeD+lVerdgMM=; b=f7Ad7CqcfaC9QSV7yoN4w36SgYfa41JNdVFHGK3gkqwNAhoRvyjMnmV8do3oR6CGEtoass k4YePV22CTEBB54CQeKQtrnw1LPBXnQUzXwfHSVYIztW1G/tzhlxBqtIGpSoXMD9A8oUJd igQNHmoA4p4ily17VyevJR1UESLyKVI= Received: from mail-pf1-f198.google.com (mail-pf1-f198.google.com [209.85.210.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-217-50rAd1sYMgWQm2jRIUo9Fg-1; Wed, 13 Apr 2022 05:35:28 -0400 X-MC-Unique: 50rAd1sYMgWQm2jRIUo9Fg-1 Received: by mail-pf1-f198.google.com with SMTP id z11-20020a62d10b000000b00507258043e7so319167pfg.16 for ; Wed, 13 Apr 2022 02:35:27 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:content-transfer-encoding :in-reply-to; bh=UTiCvYTnTb41Mgsrx3d1OeSZQnQmS6cYeD+lVerdgMM=; b=IUIpoNpa460rEn3hTWTGU68vpW8HeEgnQc2vDzsKHmXwPlhNVJwlb6MRwiH4+5OoHp QhG+0fC9szroIl3zIXU8/3+RpAYcjW2yuruKEoV6ozEgRYOZxzmz1WI4PQc1myRssPW6 UcmfkJPxwoi/UtoswHfc1FJCfxrrkohqpPJ9zPoREbRy/XTKdDYSyXG8SC1B9K4gW/Y1 jf3r/57j1d9PJfCGZSl5Nd3xv39KdW/Q6y64LgeXcFO1dcLWIAwERIBQZH6lQL4A+151 QCnMcMTWfTeFGvm6IUZ6BEZyH5nmmoIjLGDOdObeSzUjjPXV9cw+8iwVSA2JpH//KPeV 0n/Q== X-Gm-Message-State: AOAM532jAAl/DYJ75Qc0JWA6ddsT5mySRkmUx4t1YJzlaRAOPfwOvLM7 1JqoQSC6iUHrJbDL72nS+7YUBSORdITiMF8expEuYd6NPJlDxiC+YFhfvn3e6Od4b6N5v4ZdBG3 D4gqKwI6WjEVoSRr07/MOZpRTUrTT0qNflMA= X-Received: by 2002:a17:902:dad0:b0:154:740a:9094 with SMTP id q16-20020a170902dad000b00154740a9094mr41716852plx.107.1649842527009; Wed, 13 Apr 2022 02:35:27 -0700 (PDT) X-Google-Smtp-Source: ABdhPJys+jz2TENUuwNPBU3l4P+OW1M+Sw8GT68mjxOsmDociPaS8Z7e+QWM00AL5/NpBxmOn8YKWw== X-Received: by 2002:a17:902:dad0:b0:154:740a:9094 with SMTP id q16-20020a170902dad000b00154740a9094mr41716837plx.107.1649842526755; Wed, 13 Apr 2022 02:35:26 -0700 (PDT) Received: from localhost ([240e:3a1:31c:360:52fc:c968:cb41:efbc]) by smtp.gmail.com with ESMTPSA id f64-20020a17090a704600b001c77c6a391csm2247616pjk.26.2022.04.13.02.35.25 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Wed, 13 Apr 2022 02:35:25 -0700 (PDT) Date: Wed, 13 Apr 2022 17:32:36 +0800 From: Coiby Xu To: Michal =?utf-8?B?U3VjaMOhbmVr?= Cc: Baoquan He , kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Dave Young , Will Deacon , "Eric W . Biederman" , akpm@linux-foundation.org Subject: Re: [PATCH v5 0/3] use more system keyrings to verify arm64 kdump kernel image signature Message-ID: <20220413093236.faudcucbhn5jwatk@Rk> References: <20220401013118.348084-1-coxu@redhat.com> <20220408085931.GW163591@kunlun.suse.cz> <20220411015218.ckw42xx5rrhidhpd@Rk> <20220411084306.GY163591@kunlun.suse.cz> MIME-Version: 1.0 In-Reply-To: <20220411084306.GY163591@kunlun.suse.cz> Authentication-Results: relay.mimecast.com; auth=pass smtp.auth=CUSA124A263 smtp.mailfrom=coxu@redhat.com X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Disposition: inline X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220413_023534_057159_86A2188E X-CRM114-Status: GOOD ( 30.07 ) X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="iso-8859-1"; Format="flowed" Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org On Mon, Apr 11, 2022 at 10:43:06AM +0200, Michal Such=E1nek wrote: >On Mon, Apr 11, 2022 at 09:52:18AM +0800, Coiby Xu wrote: >> On Mon, Apr 11, 2022 at 09:13:32AM +0800, Baoquan He wrote: >> > On 04/08/22 at 10:59am, Michal Such=E1nek wrote: >> > > On Fri, Apr 08, 2022 at 03:17:19PM +0800, Baoquan He wrote: >> > > > Hi Coiby, >> > > > >> > > > On 04/01/22 at 09:31am, Coiby Xu wrote: >> > > > > Currently, a problem faced by arm64 is if a kernel image is sign= ed by a >> > > > > MOK key, loading it via the kexec_file_load() system call would = be >> > > > > rejected with the error "Lockdown: kexec: kexec of unsigned imag= es is >> > > > > restricted; see man kernel_lockdown.7". >> > > > > >> > > > > This patch set allows arm64 to use more system keyrings to verif= y kdump >> > > > > kernel image signature by making the existing code in x64 public. >> > > > >> > > > Thanks for updating. It would be great to tell why the problem is >> > > > met, then allow arm64 to use more system keyrings can solve it. >> > > >> > > The reason is that MOK keys are (if anywhere) linked to the secondary >> ^^^^^^^^^ >> platform? >> > > keyring, and only primary keyring is used on arm64. >> >> Thanks Michal for providing the info! Btw, I think you made a typo >> because MOK keys are linked to the platform keyring, right? > >No, I mean secondary, through this patchset: >https://lore.kernel.org/lkml/YhKP12KEmyqyS8rj@iki.fi/ Thanks for the info! This provides another approach to verify kernel image's signature via the secondary keyring once the end-use chooses to trust MOK keys by setting MokListTrustedRT. > >Apparently support for importing the MOK keys into the platform keyring >also exists but I am not sure if this is upstream or downstream feature. This is actually an upstream feature, commit 15ea0e1e3e185040bed6119f815096f2e4326242 Author: Josh Boyer Date: Thu Dec 13 01:37:56 2018 +0530 efi: Import certificates from UEFI Secure Boot = Secure Boot stores a list of allowed certificates in the 'db' variable. This patch imports those certificates into the platform keyring. The s= him UEFI bootloader has a similar certificate list stored in the 'MokListR= T' variable. We import those as well. = Secure Boot also maintains a list of disallowed certificates in the 'd= bx' variable. We load those certificates into the system blacklist keyring and forbid any kernel signed with those from loading. = [zohar@linux.ibm.com: dropped Josh's original patch description] Signed-off-by: Josh Boyer Signed-off-by: David Howells Signed-off-by: Nayna Jain Acked-by: Serge Hallyn Signed-off-by: Mimi Zohar > >At any rate the MOK keys are not included in the primary keyring which >is the only keyring currently in use for kexec on arm64. Good summary, thanks! > >Thanks > >Michal > -- = Best regards, Coiby _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel