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 57790C4332F for ; Mon, 28 Nov 2022 17:16: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:References:In-Reply-To: Date:Cc:To:From:Subject:Message-ID:Reply-To:Content-ID:Content-Description: Resent-Date:Resent-From:Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID: List-Owner; bh=DIn1o3/laasU/6yBdHGXoplxRBOgoeqYB+SCVkg7qoc=; b=oZJqH87Thu1tjy gwWv7BysuhErh1zClZ2GwdV7sf0vxox36WWRUP57GPfrnPROZ5Ef2FrilxkAN4SJh2ILdhkaFZda/ uBsAMWIlATLBoFi0HAV5xUZgKAXYbSXoe1DrNK4iEx5DS3H1Lls9QPJ+eCIdcwpKfeYDCzuf9bkcw 0LhEd243fmhogbZmy7jIfU5wY802RbJwkU9mOHTplQi9RGD4dV9FJ8n5jQepOn6ziBLLc6y12LBQW EsZDW4tHYKv546STnTyoLvjR4zrCzuk9tFQ72ox1GFNffqNGRekilrw4okvA5+whk7gp+OEOtirZM sXW5mDamDSC+H3sAT4Bg==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozhjz-0031gt-LQ; Mon, 28 Nov 2022 17:16:23 +0000 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1ozhjw-0031ds-6g for kexec@lists.infradead.org; Mon, 28 Nov 2022 17:16:21 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ASFvbRZ032038; Mon, 28 Nov 2022 17:16:13 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=ibm.com; h=message-id : subject : from : to : cc : date : in-reply-to : references : content-type : mime-version : content-transfer-encoding; s=pp1; bh=RZJVGDX/6B5Oe0iNQFvKjIT62omfWmQKvG7j7+mkPXg=; b=K3Iy9/sJ/sx1tmzXN7yRnRY+uDt7IvrHNw05L6MvmciQAs3HawKBYsgTo8427zAmPH+F IMRqOtQayO6L/xm44knAHK2uDCaE4mFfkPcEKAxYNZfbtobPQ96ELI9xAQVIcelO/TBm KEXMv1TjyK7DVSEhRctWywQEcijWuasrXB6IfqQIPCbK5WQx1CbN3HddcVaECwWi8yfA xgmMSpvggCAK1wtz+yNryWivvRps9BRpbiKzd/QQSJA+JLNkwansm1crg0zn0X+GmOmO YyVP5S0nNh7YUrpQNXnBHRWZvL/O4bAdeJr//XiPHC7XZy5XLFrMrh/fk1AngH0viBKt EA== Received: from pps.reinject (localhost [127.0.0.1]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m3vjdfpg3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:16:12 +0000 Received: from m0098410.ppops.net (m0098410.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2ASGrMPK002723; Mon, 28 Nov 2022 17:16:12 GMT Received: from ppma01dal.us.ibm.com (83.d6.3fa9.ip4.static.sl-reverse.com [169.63.214.131]) by mx0a-001b2d01.pphosted.com (PPS) with ESMTPS id 3m3vjdfpf7-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:16:12 +0000 Received: from pps.filterd (ppma01dal.us.ibm.com [127.0.0.1]) by ppma01dal.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ASH9NBV027840; Mon, 28 Nov 2022 17:16:10 GMT Received: from b03cxnp08027.gho.boulder.ibm.com (b03cxnp08027.gho.boulder.ibm.com [9.17.130.19]) by ppma01dal.us.ibm.com with ESMTP id 3m3ae9tmf2-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 28 Nov 2022 17:16:10 +0000 Received: from smtpav06.dal12v.mail.ibm.com ([9.208.128.130]) by b03cxnp08027.gho.boulder.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ASHG5Sv23724522 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 28 Nov 2022 17:16:05 GMT Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 098E958055; Mon, 28 Nov 2022 17:16:09 +0000 (GMT) Received: from smtpav06.dal12v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 5DC3058043; Mon, 28 Nov 2022 17:16:08 +0000 (GMT) Received: from li-f45666cc-3089-11b2-a85c-c57d1a57929f.ibm.com (unknown [9.160.26.105]) by smtpav06.dal12v.mail.ibm.com (Postfix) with ESMTP; Mon, 28 Nov 2022 17:16:08 +0000 (GMT) Message-ID: <2204915d319ff9acf80f68ccba8600aaeb5578d7.camel@linux.ibm.com> Subject: Re: [PATCH] lockdown: kexec_file: prevent unsigned kernel image when KEXEC_SIG not enabled From: Mimi Zohar To: Coiby Xu Cc: kexec@lists.infradead.org, Matthew Garrett , Jiri Bohac , David Howells , linux-integrity@vger.kernel.org, Eric Biederman , James Morris , Matthew Garrett , open list Date: Mon, 28 Nov 2022 12:16:08 -0500 In-Reply-To: <20221122023606.nrifkrng5nbfmkka@Rk> References: <20221121072947.836672-1-coxu@redhat.com> <5d98172d77a8a0f1e3daab44ad51bf38978cc053.camel@linux.ibm.com> <20221122023606.nrifkrng5nbfmkka@Rk> X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 X-TM-AS-GCONF: 00 X-Proofpoint-GUID: mqijHTnZy1VBf3pmbGa_r2tIH2ydgGu9 X-Proofpoint-ORIG-GUID: irI5J7NUXvt-rvRcC-babNVDtv_cJtnT X-Proofpoint-Virus-Version: vendor=baseguard engine=ICAP:2.0.219,Aquarius:18.0.895,Hydra:6.0.545,FMLib:17.11.122.1 definitions=2022-11-28_14,2022-11-28_02,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 mlxlogscore=709 bulkscore=0 spamscore=0 suspectscore=0 clxscore=1015 impostorscore=0 phishscore=0 lowpriorityscore=0 adultscore=0 mlxscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211280126 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20221128_091620_515244_81807691 X-CRM114-Status: GOOD ( 25.01 ) X-BeenThere: kexec@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: "kexec" Errors-To: kexec-bounces+kexec=archiver.kernel.org@lists.infradead.org On Tue, 2022-11-22 at 10:36 +0800, Coiby Xu wrote: > Hi Mimi, > > On Mon, Nov 21, 2022 at 01:23:57PM -0500, Mimi Zohar wrote: > >Hi Coiby, > > > >On Mon, 2022-11-21 at 15:29 +0800, Coiby Xu wrote: > >> A kernel builder may not enable KEXEC_SIG and some architectures like > >> ppc64 simply don't have KEXEC_SIG. In these cases, unless both > >> IMA_ARCH_POLICY and secure boot also enabled, lockdown doesn't prevent > >> unsigned kernel image from being kexec'ed via the kexec_file_load > >> syscall whereas it could prevent one via the kexec_load syscall. Mandate > >> signature verification for those cases. > >> > >> Fixes: 155bdd30af17 ("kexec_file: Restrict at runtime if the kernel is locked down") > >> Cc: Matthew Garrett > >> Cc: Jiri Bohac > >> Cc: David Howells > >> Cc: kexec@lists.infradead.org > >> Cc: linux-integrity@vger.kernel.org > >> Signed-off-by: Coiby Xu > > > >Other than correcting the function name to mandate_signature_verificati > >on(), > > Applied to v2, thanks for correcting me! Btw, I realize I overwrote the > return code of kexec_image_verify_sig with > mandate_signature_verification's. v2 has fixed this issue as well. > > > > >Reviewed-by: Mimi Zohar > > And thanks for the review! You're welcome. Without either IMA_ARCH or KEXEC_SIG enabled, the kexec selftest test_kexec_file_load.sh properly failed with "kexec_file_load failed [PASS]", but from the informational messages output, it isn't clear why it failed. This should be corrected. -- thanks, Mimi _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec