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 mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E9755C433EF for ; Sat, 9 Oct 2021 09:59:50 +0000 (UTC) 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 mail.kernel.org (Postfix) with ESMTPS id B8AB660F24 for ; Sat, 9 Oct 2021 09:59:50 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.4.1 mail.kernel.org B8AB660F24 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=redhat.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=lists.infradead.org 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=homKlvrqk2YpeFGpTbzsT6sFIoRn9Jv0lAeRLt7Flak=; b=Qe/IXJzU59/yN9 9duLfWLkMmKTj6OsABLa2DxwE5DONMRiqnmPFOcKxEkXxsfEnXhUnqzp8VdBccmt7TDZGUyksy+1M mjZ/7lC4LAU6i2krvtJ7mfMLovPO7vTTdy5qbTnoWSC8hsP1MDi20z6rQ1oEK20r/9sj00I5RBiYj oSVscLpkA1RA0D27eA4x5p0Hy8jmWC39DX8pz1Alyk7QmlbX2wbtUaTtUHlTWphJEEKhbt2TLcF/i NtJFQ1bIZ8NuJJ9VP/ydBN6Huf1QhbH75LiaOmK0VMHMajPBLLDgNUP695tEVL2tYggA3Ft37yZzV SSb5Me88tL5CoSQ2mM+A==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1mZ97G-005OYK-5R; Sat, 09 Oct 2021 09:58:06 +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 1mZ97C-005OWv-KM for linux-arm-kernel@lists.infradead.org; Sat, 09 Oct 2021 09:58:03 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1633773481; 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=7pixb7rhSe9gW9mPovHeBhJ7x5GxJTOJKpjxWylVhVA=; b=I8KK1ScbDdDtKdgUul5g41rVLZAEVN4ULVIT2knf6Z9i3Zv5OfqgEjaQGEHnsHkSKQBk9/ IvtNBrFfaRoqK1QMAnkM44fNKRjAsmgh/UFWsVWFFea+akN9+7ua/ZVbfNozpxkfNUYmEA pKbcssu85vt3SLfhNeQhVSWRaP6GhjY= Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-534-9uUgVd2HOxWugnjRhjGvBg-1; Sat, 09 Oct 2021 05:55:23 -0400 X-MC-Unique: 9uUgVd2HOxWugnjRhjGvBg-1 Received: by mail-pg1-f200.google.com with SMTP id n9-20020a63e049000000b002951886c1c5so3296770pgj.0 for ; Sat, 09 Oct 2021 02:55:23 -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=7pixb7rhSe9gW9mPovHeBhJ7x5GxJTOJKpjxWylVhVA=; b=JLCl86DKow5q8RdPCFyKjmlNxjfTzoEmMWNjLAWEO3renGGMFge4Q8/jyOWquw+jsl RqAfhloDU8d7PoWLUJdtjBVXHDH2bJw2CnfR7LNQm7oWUfSJHYQ/pY+uRofdWH6LjOfg Q7W3itzO+nFysnSfYc9B6+3fL5IGvJkPYuGeXBWoz31NxD6YdFw+TBt85/cQ81ekv9vB QI0MElLop13JPgX0JH/0iwNHPmGQW6ZOzdEXJt/XifnVh77DdPSGaBhnOq8TqYp2Ol+K 173iYt3UbuP5djHmUQi/JNFaZT69X+9tmEDLUbF8ZkT4/unjR02jm7HiyZ17gRJd0pdX a1hw== X-Gm-Message-State: AOAM533QkvRkIksl9E4OL9NScOem1gOLvbM3NXhtQLQWDtjetVI/Mp9m 23zuBdW6WmgzI3/wirIn6+yC15fJtvjdRqVfJ5VprB1idWh04WV9gcYdUg3Fly07fNgrcWq6fXV IAsZEUN6PI60XFBZai+3VhCladf2aRo/ZHz8= X-Received: by 2002:a17:90a:5515:: with SMTP id b21mr17273645pji.239.1633773322278; Sat, 09 Oct 2021 02:55:22 -0700 (PDT) X-Google-Smtp-Source: ABdhPJz1rCjIedQornvFaznhwr+Y/s6YTuLq2BT1YqbQI1e6qIeVqUoNK1CiLqatpJukq936/FQJzQ== X-Received: by 2002:a17:90a:5515:: with SMTP id b21mr17273625pji.239.1633773322100; Sat, 09 Oct 2021 02:55:22 -0700 (PDT) Received: from localhost ([240e:473:3c30:93d:5429:b8e4:3097:6ec8]) by smtp.gmail.com with ESMTPSA id r8sm2023753pgp.30.2021.10.09.02.55.20 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Sat, 09 Oct 2021 02:55:21 -0700 (PDT) From: Coiby Xu To: kexec@lists.infradead.org Cc: linux-arm-kernel@lists.infradead.org, Dave Young , Will Deacon , Catalin Marinas , linux-kernel@vger.kernel.org (open list) Subject: [PATCH v2 2/2] arm64: kexec_file: use more system keyrings to verify kernel image signature Date: Sat, 9 Oct 2021 17:54:58 +0800 Message-Id: <20211009095458.297191-3-coxu@redhat.com> X-Mailer: git-send-email 2.31.1 In-Reply-To: <20211009095458.297191-1-coxu@redhat.com> References: <20211009095458.297191-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-20211009_025802_750587_7B21BB90 X-CRM114-Status: GOOD ( 10.77 ) 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 This allows to verify arm64 kernel image signature using not only .builtin_trusted_keys but also .secondary_trusted_keys and .platform 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..2357ee2f229a 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 arch_kexec_kernel_verify_pe_sig(kernel, kernel_len); } #endif -- 2.31.1 _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel