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 CFF66C433F5 for ; Fri, 1 Apr 2022 01:33:43 +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-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:References:In-Reply-To: Message-Id:Date:Subject:Cc:To:From:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=uova1sNyynHLEDH3ymuchY5u3kplYpYuujGr8bEGDg8=; b=f3J3D31mdAL8/v ftBapCM4d9zmMykma3jrJLgIydGQyzVU+degB1p7PRlcU3GNcnwt68dNzzWEUGyZeeZKjOyvZFai1 Hp8Oh8ybMOoH8OsAsWzgT+6Y3VMM51fcTp4ghYXgcRZ+PFuEbFUrt4tx0yvXvs21IcC6Hrhuu+HMH Vsp/mGmrpPOYxCXZJJbO58dY/0bAEeHQ7l0mtGKgJVCCbzbomrRYWdgpQ6lZoynpN5dUl0HVObanV M8lChVScz2sfAVzgGYv+ySsRM82VEDwDJ9UFx/fcVx6WZ3pVGb1CC5iYFDf5h/rozjemwBzT5s7Go V3lQsYAg+uS+miCK9xOA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1na68x-004ArG-8G; Fri, 01 Apr 2022 01:32:03 +0000 Received: from us-smtp-delivery-124.mimecast.com ([170.10.133.124]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1na68U-004Ajz-OB for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2022 01:31:36 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648776693; 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=Ur4bX7kLocMyHlMkWd6be/nI5FhdYUXpSu22PLx25Yc=; b=O2svxs8cdXpCvAjxACuk+MKQ2IHbu9wXdtU2jbpFyEnaAvHADeKOynY0zQCEafNLPk8iUJ vZr6mfYVDoOXQcv69s/enoEppOrrF7UWNx9hVEFKstlv43wl6fd1Ux1uP5auGQYYHhvw45 iFWLMZWwBWY6POfdqEDIkefLejjZjGM= Received: from mail-pj1-f72.google.com (mail-pj1-f72.google.com [209.85.216.72]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-52-ON9iDdqUMtKWQLciJn9DLg-1; Thu, 31 Mar 2022 21:31:32 -0400 X-MC-Unique: ON9iDdqUMtKWQLciJn9DLg-1 Received: by mail-pj1-f72.google.com with SMTP id iq24-20020a17090afb5800b001c685a314d6so439791pjb.4 for ; Thu, 31 Mar 2022 18:31:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references:mime-version:content-transfer-encoding; bh=Ur4bX7kLocMyHlMkWd6be/nI5FhdYUXpSu22PLx25Yc=; b=OoVEA4XKJ9dK3pQ5xcaGb3CrlBX/4As0zBzoFR2Y+EuKrotZK66T/43hJh98uhWfi4 R1p7U2E+DDSKbqh7ztH+LkuYsd7m1bo9dDsiVbnhjAIff9V6uPe0dqZvtG7YulAy1uQU 3dk9P3mnu2KcFf/nSREKsziJFUWolpkoPD9ElOQtHa4kOPTnG61sAcknVZoGOs/kR4dj SyFsqSRuH8SKF48tK980qbc3XEocIBuLexjpiRFrAz8o/Jy62b2i5+Qpx5S1nD8tL8wV 5uf56zzMQhEkRbwAO8Ot+2Gc0UfEDrIrSZPiWvBPzMsVvJzAbvY27oGqTpPVTlHX9NYS FmqA== X-Gm-Message-State: AOAM531bJw2YFCxxmJL2u7pGyJ4jV1+R7XKqcODBjvUZoGW2DejUo924 6eYBZPX1KpCTKfXKmZToWgRxnPnRF228KZFDCgUR2Elc6jfLhPKHfhAg9NBqt/B4/liN2LwvMKI JsAYeBd9p5PmrOTFJ0YDmEIhWfCcqw9Ex1RA= X-Received: by 2002:a17:902:708b:b0:156:1a0a:5c3d with SMTP id z11-20020a170902708b00b001561a0a5c3dmr7767914plk.18.1648776691480; Thu, 31 Mar 2022 18:31:31 -0700 (PDT) X-Google-Smtp-Source: ABdhPJytKI0smTf2h5pDtZ1Ru/oJPC2Djio4Q2XzblwlhHZObk3685LSZ1jxpUWN1pqTW4oEpdgQqA== X-Received: by 2002:a17:902:708b:b0:156:1a0a:5c3d with SMTP id z11-20020a170902708b00b001561a0a5c3dmr7767892plk.18.1648776691177; Thu, 31 Mar 2022 18:31:31 -0700 (PDT) Received: from localhost ([240e:3a1:31c:360:52fc:c968:cb41:efbc]) by smtp.gmail.com with ESMTPSA id y15-20020a17090a1f4f00b001c7ecaf9e13sm544181pjy.35.2022.03.31.18.31.30 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 18:31:30 -0700 (PDT) From: Coiby Xu To: kexec@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, Baoquan He , Dave Young , Will Deacon , "Eric W . Biederman" , Catalin Marinas , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v5 3/3] arm64: kexec_file: use more system keyrings to verify kernel image signature Date: Fri, 1 Apr 2022 09:31:18 +0800 Message-Id: <20220401013118.348084-4-coxu@redhat.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20220401013118.348084-1-coxu@redhat.com> References: <20220401013118.348084-1-coxu@redhat.com> MIME-Version: 1.0 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 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220331_183134_898177_D38AFBCD X-CRM114-Status: GOOD ( 13.15 ) 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-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+linux-arm-kernel=archiver.kernel.org@lists.infradead.org Currently, a problem faced by arm64 is if a kernel image is signed by a MOK key, loading it via the kexec_file_load() system call would be rejected with the error "Lockdown: kexec: kexec of unsigned images is restricted; see man kernel_lockdown.7". This patch allows to verify arm64 kernel image signature using not only .builtin_trusted_keys but also .platform and .secondary_trusted_key keyring. Acked-by: Will Deacon Signed-off-by: Coiby Xu --- arch/arm64/kernel/kexec_image.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/kernel/kexec_image.c b/arch/arm64/kernel/kexec_image.c index 9ec34690e255..51af1c22d6da 100644 --- a/arch/arm64/kernel/kexec_image.c +++ b/arch/arm64/kernel/kexec_image.c @@ -14,7 +14,6 @@ #include #include #include -#include #include #include #include @@ -133,8 +132,7 @@ static void *image_load(struct kimage *image, #ifdef CONFIG_KEXEC_IMAGE_VERIFY_SIG static int image_verify_sig(const char *kernel, unsigned long kernel_len) { - return verify_pefile_signature(kernel, kernel_len, NULL, - VERIFYING_KEXEC_PE_SIGNATURE); + return kexec_kernel_verify_pe_sig(kernel, kernel_len); } #endif -- 2.34.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel