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 D77F5C433F5 for ; Mon, 18 Apr 2022 02:12:24 +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: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=FLuMMFrdDXQ1JvD4AMmO3W+P7GivSdYI6uqjPIr2HeA=; b=FqJtinETqLJq1M XUC1ERfF/rhftWuf8HAN5bF5RfsrbMvrAJNtyTFAkxTPPoZyL4DLJvJDl05yX+ITH/kRiTU92l+Fz sbCsjpsL8ykBZVjimNG2GvqY6RtKneOCa3ralWJqG+POzDHigPj31ENlNaSZarVIL8zbGXn7zAuRM XRAzDgfCG7fA7/yBxao/G28IpDov4LHjjkchou90grEPD1O6HDbHQLhnH016k35C6clvV/GTMWdSv ia7prnOxIHOZItysBizWR90laRJd2DuvjT7rG47ICpn0oBtE01YV5Y9DcjHaa6/VdLoN8IhcJQXV4 CQxfOGFZtEu97KQeQbzg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ngGrC-00FJ7Z-29; Mon, 18 Apr 2022 02:11:14 +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 1ngGr9-00FJ72-3A for linux-arm-kernel@lists.infradead.org; Mon, 18 Apr 2022 02:11:12 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=redhat.com; s=mimecast20190719; t=1650247869; 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: in-reply-to:in-reply-to:references:references; bh=ZKaQFNHJPrlVC1wRNehHPLwYyKFIA2KNeeEMoRic3Y0=; b=B0TW+7PYAos/hfm2CfsQDejWiYUIrSIcesK+C9I5oovKXVF3c8l1D3WkAkmBovb/yl/eEI tRU+yjmp97w7/2GhL2A88P2xln+sUfZi5q3gYnyXlEsULLZDU+1l7TE+CXY3Va5H518JyO 3r4CPzLSH88iaEb8K0wjI7tKVfblf9c= Received: from mimecast-mx02.redhat.com (mx3-rdu2.redhat.com [66.187.233.73]) by relay.mimecast.com with ESMTP with STARTTLS (version=TLSv1.2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id us-mta-303-WDnMna3fO8-lP_vzT6cKaw-1; Sun, 17 Apr 2022 22:11:08 -0400 X-MC-Unique: WDnMna3fO8-lP_vzT6cKaw-1 Received: from smtp.corp.redhat.com (int-mx08.intmail.prod.int.rdu2.redhat.com [10.11.54.8]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx02.redhat.com (Postfix) with ESMTPS id 6B96929AB3F1; Mon, 18 Apr 2022 02:11:07 +0000 (UTC) Received: from localhost (ovpn-12-21.pek2.redhat.com [10.72.12.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 2FB7DC28105; Mon, 18 Apr 2022 02:11:06 +0000 (UTC) Date: Mon, 18 Apr 2022 10:11:02 +0800 From: Baoquan He To: Coiby Xu Cc: kexec@lists.infradead.org, linux-arm-kernel@lists.infradead.org, Michal Suchanek , Dave Young , Will Deacon , "Eric W . Biederman" , Mimi Zohar , Chun-Yi Lee , Philipp Rudo , keyrings@vger.kernel.org, linux-security-module@vger.kernel.org, stable@kernel.org, Heiko Carstens , Vasily Gorbik , Alexander Gordeev , Christian Borntraeger , Sven Schnelle , Martin Schwidefsky , "open list:S390" , open list Subject: Re: [PATCH v6 4/4] kexec, KEYS, s390: Make use of built-in and secondary keyring for signature verification Message-ID: References: <20220414014344.228523-1-coxu@redhat.com> <20220414014344.228523-5-coxu@redhat.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <20220414014344.228523-5-coxu@redhat.com> X-Scanned-By: MIMEDefang 2.85 on 10.11.54.8 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220417_191111_246600_566DD59C X-CRM114-Status: GOOD ( 19.33 ) 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 On 04/14/22 at 09:43am, Coiby Xu wrote: > From: Michal Suchanek > > commit e23a8020ce4e ("s390/kexec_file: Signature verification prototype") > adds support for KEXEC_SIG verification with keys from platform keyring > but the built-in keys and secondary keyring are not used. > > Add support for the built-in keys and secondary keyring as x86 does. > > Fixes: e23a8020ce4e ("s390/kexec_file: Signature verification prototype") Should Cc stable kernel? Otherwise, LGTM, Acked-by: Baoquan He > Cc: Philipp Rudo > Cc: kexec@lists.infradead.org > Cc: keyrings@vger.kernel.org > Cc: linux-security-module@vger.kernel.org > Cc: stable@kernel.org > Signed-off-by: Michal Suchanek > Reviewed-by: "Lee, Chun-Yi" > Signed-off-by: Coiby Xu > --- > arch/s390/kernel/machine_kexec_file.c | 18 +++++++++++++----- > 1 file changed, 13 insertions(+), 5 deletions(-) > > diff --git a/arch/s390/kernel/machine_kexec_file.c b/arch/s390/kernel/machine_kexec_file.c > index 8f43575a4dd3..fc6d5f58debe 100644 > --- a/arch/s390/kernel/machine_kexec_file.c > +++ b/arch/s390/kernel/machine_kexec_file.c > @@ -31,6 +31,7 @@ int s390_verify_sig(const char *kernel, unsigned long kernel_len) > const unsigned long marker_len = sizeof(MODULE_SIG_STRING) - 1; > struct module_signature *ms; > unsigned long sig_len; > + int ret; > > /* Skip signature verification when not secure IPLed. */ > if (!ipl_secure_flag) > @@ -65,11 +66,18 @@ int s390_verify_sig(const char *kernel, unsigned long kernel_len) > return -EBADMSG; > } > > - return verify_pkcs7_signature(kernel, kernel_len, > - kernel + kernel_len, sig_len, > - VERIFY_USE_PLATFORM_KEYRING, > - VERIFYING_MODULE_SIGNATURE, > - NULL, NULL); > + ret = verify_pkcs7_signature(kernel, kernel_len, > + kernel + kernel_len, sig_len, > + VERIFY_USE_SECONDARY_KEYRING, > + VERIFYING_MODULE_SIGNATURE, > + NULL, NULL); > + if (ret == -ENOKEY && IS_ENABLED(CONFIG_INTEGRITY_PLATFORM_KEYRING)) > + ret = verify_pkcs7_signature(kernel, kernel_len, > + kernel + kernel_len, sig_len, > + VERIFY_USE_PLATFORM_KEYRING, > + VERIFYING_MODULE_SIGNATURE, > + NULL, NULL); > + return ret; > } > #endif /* CONFIG_KEXEC_SIG */ > > -- > 2.34.1 > > _______________________________________________ linux-arm-kernel mailing list linux-arm-kernel@lists.infradead.org http://lists.infradead.org/mailman/listinfo/linux-arm-kernel