From patchwork Fri Apr 1 01:31:15 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Coiby Xu X-Patchwork-Id: 12797835 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 90314C433EF for ; Fri, 1 Apr 2022 01:33:29 +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: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:In-Reply-To:References: List-Owner; bh=Eg8QJSsj4/A9XIwlWnEMskOR53Oiy0zc5DOie4+iV/A=; b=nSvJ0atRj/A1TQ DgW823bbYcqFeTXeo7FB+HyY4liXY/LqjUYGii/l1QKJhiaIqgeUBjH987mo+LBm5Jo2oGEMGqF+l uoc8/hOVvLTUmXF0wD//HHxVUy8s+BiyOrkzgO5ZQHfSU3Y5WYdYDr84Ybt84EC2PUeecyAC01nnC DUCr+mQaRsMziKtB0rPYa9nIzzSE9849sU2xMflYIKX47YdXKfkWEZUEefDG0Jfu/u3UBgDyxOU5j xls2Zw/WSSOnVzXyl9Lgm+1qIsw3zPwc2ykJKDe8vVvjr64c2JaLhXmTbMESDcOT2/AnuYngXZpF7 rL0KvlYtGSTjLc/Da4Mg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1na68Q-004Aiu-6C; Fri, 01 Apr 2022 01:31:30 +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 1na68N-004Ahq-2P for linux-arm-kernel@lists.infradead.org; Fri, 01 Apr 2022 01:31:28 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1648776683; 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; bh=dCRUwtvSOoi1H038zsWhei2rxf2ml6+MYR6GQudn2oE=; b=FO+ioEQyqRd1U7LufgyhKrwbDmEHdb1UP2aCHc2G0bgZd9dPZKbDTEg6jkK7pE59X05h0V ypMFMNXciJir3+J+NxxO59XA72N/Rm7q2kYXp4ZfZ8D7o0cMB8FEjTxBnSV0IBReLUW9xV aWB6ykBNfzArHXJXtq0d8zyK6sLPa0o= Received: from mail-pl1-f198.google.com (mail-pl1-f198.google.com [209.85.214.198]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-638-iY5Tl_i1NCmXPE8y4eOzCQ-1; Thu, 31 Mar 2022 21:31:22 -0400 X-MC-Unique: iY5Tl_i1NCmXPE8y4eOzCQ-1 Received: by mail-pl1-f198.google.com with SMTP id r16-20020a170903021000b00155f7af17b6so615284plh.16 for ; Thu, 31 Mar 2022 18:31:22 -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:mime-version :content-transfer-encoding; bh=dCRUwtvSOoi1H038zsWhei2rxf2ml6+MYR6GQudn2oE=; b=t01GP/svR8qmgSRS3J4ktdKRZTZyUoK/9oO1/rsCH5ZILc2p0wgcvp/MAm/980QbLO Yb8MZPD82h3nrHfKK9VPxCGDUo4WFo6NjAQDilvc/wSvLl01BhJmB8uj6Voq8DUr5V8B f7JwJ/EvZ4wM22cxNbXp8Jp+pGRt1jGc/ZkZ219wD2UxFJG8oFLZPi0qKKCp6TXZxPlX JBoRY7tAwVQMIY/4KKq1Vqy2TPMGHYXkMUtme8W5ViFsaDu6LR1tncc5YW3B3xqYJfeM r36Q5BFlgMrJWO1yQpNZTUG0tLSfUjHlY0P9L8WHU08Xs1fSlnD2fMmz9trUHW9ApjnN 8XNw== X-Gm-Message-State: AOAM5335Cu7/EAkK2UdOX9wIrNo43eam5b/GHyyJkTI2dpYYad1DuzjP HqWXIiqf+k7rA34XXrgvsoadiCYIaoHmM+Y1kL6jA/uGxU+/LaryPYm5mtqYUe5+qUr/xNibX5Z cC8g0Z/LGco00uyeXAER55ZU2pXAjc5/RJLI= X-Received: by 2002:a63:7d02:0:b0:398:9594:63f4 with SMTP id y2-20020a637d02000000b00398959463f4mr11910710pgc.375.1648776681605; Thu, 31 Mar 2022 18:31:21 -0700 (PDT) X-Google-Smtp-Source: ABdhPJwgIf72Eduvz3ylx7+tx5xRHSJq7MbXdPnr7DVsWXLsUcODb2PwB54L53yP6yAzSVCtBusodw== X-Received: by 2002:a63:7d02:0:b0:398:9594:63f4 with SMTP id y2-20020a637d02000000b00398959463f4mr11910687pgc.375.1648776681261; Thu, 31 Mar 2022 18:31:21 -0700 (PDT) Received: from localhost ([240e:3a1:31c:360:52fc:c968:cb41:efbc]) by smtp.gmail.com with ESMTPSA id q22-20020a056a00085600b004fb308e393csm721744pfk.178.2022.03.31.18.31.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 31 Mar 2022 18:31:20 -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" Subject: [PATCH v5 0/3] use more system keyrings to verify arm64 kdump kernel image signature Date: Fri, 1 Apr 2022 09:31:15 +0800 Message-Id: <20220401013118.348084-1-coxu@redhat.com> X-Mailer: git-send-email 2.34.1 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_183127_225437_42E77077 X-CRM114-Status: GOOD ( 11.08 ) 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: , 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 set allows arm64 to use more system keyrings to verify kdump kernel image signature by making the existing code in x64 public. v5: - improve commit message [Baoquan] v4: - fix commit reference format issue and other checkpatch.pl warnings [Baoquan] v3: - s/arch_kexec_kernel_verify_pe_sig/kexec_kernel_verify_pe_sig [Eric] - clean up arch_kexec_kernel_verify_sig [Eric] v2: - only x86_64 and arm64 need to enable PE file signature check [Dave] Coiby Xu (3): kexec: clean up arch_kexec_kernel_verify_sig kexec, KEYS: make the code in bzImage64_verify_sig generic arm64: kexec_file: use more system keyrings to verify kernel image signature arch/arm64/kernel/kexec_image.c | 4 +-- arch/x86/kernel/kexec-bzimage64.c | 13 +------- include/linux/kexec.h | 7 +++-- kernel/kexec_file.c | 51 ++++++++++++++++++------------- 4 files changed, 37 insertions(+), 38 deletions(-)