From patchwork Sat Aug 24 11:12:34 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Li Zetao X-Patchwork-Id: 13776405 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 16837C52D6F for ; Sat, 24 Aug 2024 11:06:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender:List-Subscribe:List-Help :List-Post:List-Archive:List-Unsubscribe:List-Id:Content-Type: Content-Transfer-Encoding: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=t+1UMlf4++c/quiwRSU2fk7YBYM/qhD2BJDDM1XRmt8=; b=sYNvktDBrTP0TXub9360dGVfYI BeLwl554JYEQPeeGJ0AezQ9wrZH2DVCumyatC2tvuQyVAA+no7KzFYPEO/kuNjQcHdhKXyq5G9+bB gF0VBb62I9qvrVZpe8NGHZy38sflhDjbQ1jFkCG6/qv06tlZEv1F9ABw1rMCa13DNFbudCsddiMqZ 604j0upc9hmEH6lLofh6s9h09zDsxndButMnF6WDVPtDbsbTTS02M5pR96hF7ucMCeF9Sb/+RmG2d 2JHN44WUaieYvl8N9GqJLQnhMVxFZtyqthyxFrWXaQ7fZEFcwY9u2IEttMrrBaZKHtHOxbxL4Xkn7 2y4rXEEA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.97.1 #2 (Red Hat Linux)) id 1shob8-000000025Xp-0dqE; Sat, 24 Aug 2024 11:06:22 +0000 Received: from szxga08-in.huawei.com ([45.249.212.255]) by bombadil.infradead.org with esmtps (Exim 4.97.1 #2 (Red Hat Linux)) id 1shoaL-000000025SK-3ait for linux-arm-kernel@lists.infradead.org; Sat, 24 Aug 2024 11:05:36 +0000 Received: from mail.maildlp.com (unknown [172.19.163.252]) by szxga08-in.huawei.com (SkyGuard) with ESMTP id 4WrYwP0vScz13wB7; Sat, 24 Aug 2024 19:04:05 +0800 (CST) Received: from kwepemd500012.china.huawei.com (unknown [7.221.188.25]) by mail.maildlp.com (Postfix) with ESMTPS id 0BADC1800D2; Sat, 24 Aug 2024 19:04:48 +0800 (CST) Received: from huawei.com (10.90.53.73) by kwepemd500012.china.huawei.com (7.221.188.25) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1258.34; Sat, 24 Aug 2024 19:04:47 +0800 From: Li Zetao To: , CC: , , Subject: [PATCH -next] arm64: enable ARCH_SUPPORTS_KEXEC_SIG_FORCE for arm64 Date: Sat, 24 Aug 2024 19:12:34 +0800 Message-ID: <20240824111234.2216355-1-lizetao1@huawei.com> X-Mailer: git-send-email 2.34.1 MIME-Version: 1.0 X-Originating-IP: [10.90.53.73] X-ClientProxiedBy: dggems705-chm.china.huawei.com (10.3.19.182) To kwepemd500012.china.huawei.com (7.221.188.25) X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20240824_040534_295553_28649D9F X-CRM114-Status: UNSURE ( 8.59 ) X-CRM114-Notice: Please train this message. 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 When the CONFIG_KEXEC_SIG is enabled, an illegal image is loaded through kexec, and the illegal image is successfully loaded. The test example is as follows: # cat /sys/kernel/kexec_loaded 0 # kexec -s -l ./Image.illegal_signature # echo $? 0 # dmesg | tail PEFILE: Digest mismatch # cat /sys/kernel/kexec_loaded 1 The root cause of this problem is that CONFIG_KEXEC_SIG_FORCE is not enabled. Solve this problem by enabling the ARCH_SUPPORTS_KEXEC_SIG_FORCE feature. Signed-off-by: Li Zetao --- arch/arm64/Kconfig | 3 +++ 1 file changed, 3 insertions(+) diff --git a/arch/arm64/Kconfig b/arch/arm64/Kconfig index a2f8ff354ca6..9952c40a2bd8 100644 --- a/arch/arm64/Kconfig +++ b/arch/arm64/Kconfig @@ -1549,6 +1549,9 @@ config ARCH_SELECTS_KEXEC_FILE config ARCH_SUPPORTS_KEXEC_SIG def_bool y +config ARCH_SUPPORTS_KEXEC_SIG_FORCE + def_bool y + config ARCH_SUPPORTS_KEXEC_IMAGE_VERIFY_SIG def_bool y