Received: by 2002:a05:6358:d09b:b0:dc:cd0c:909e with SMTP id jc27csp4707162rwb; Mon, 21 Nov 2022 10:47:30 -0800 (PST) X-Google-Smtp-Source: AA0mqf66Ls5mRECCV95ohjUcz60+QwCLaZXdmr11aCF4wSOkkWUOb4OcEzji6zJpw5ZTCXhaHHbx X-Received: by 2002:a17:902:bd94:b0:186:b063:339 with SMTP id q20-20020a170902bd9400b00186b0630339mr18774pls.70.1669056449774; Mon, 21 Nov 2022 10:47:29 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1669056449; cv=none; d=google.com; s=arc-20160816; b=vjIIvb/Zcb6G1hpEQlYYBME3MBSV4hjS/ZWJmQFaBcEYGB9agEsUidaOUB3yOAk8k/ adpOwRL46tRqwXykF+D3xUIBpB0TfI+ObG4LHwaKMfwIhYBDgNUavezoFapJR2N+dz/l FEgj7BSl5wCrxlvWiDQODj0Rx/jwMW0ZTGjDFVMUysr+1UD09sEKHlX1+vBV5C9/dWht xt9LRcKqLl3f/cqMhMrlrn21OqqHW5SW8f5lalZQbohs3ZT+2zLY0RvYnE4sQ9x/XzKy 2R4vO3IyWiMuI5EJ6zCCIG/sNEU/uvZ6SLBJzA/r3XiI3tMQ1lcNf4iu3QAQ0SOt6a7Z 1zjA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :dkim-signature; bh=AMtjW6WLFCULVG/XV+qA98xsr1zwM1JGCHIM1oBMy+g=; b=egK5jlFnNsBaEpnD2rU+gdCsoBsm//Z+vZpmLcDctZFyIMYQ5dcIu1CR75bTMob05P q/FHumDolaD9+JR3s7K/arA4KPL/cI1DGV0I/ZUALKkNku4iD7UN4GgT0phuG6KjupX9 1plRhxsKDCVY370ovWLN60lN8pw/fEo9WdiZ+C8ME91VISwHE+W+z5zSVhe3WYYBcH17 affmfHGeri5+ja93T1POOd8cuJYmk77sdrreci2nLZ3hneDcsTcd2jT83ahds7PMCbGY kice3J/MQ9ixnVb3db4vol5VsmQOlR8fF1pyMqUhvx73S6g5pIyxVkznpSJ9jG7Acj5l siyA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mesbrjG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id i189-20020a6387c6000000b00476ef2a5eb7si12158679pge.91.2022.11.21.10.47.18; Mon, 21 Nov 2022 10:47:29 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@ibm.com header.s=pp1 header.b=mesbrjG7; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=REJECT sp=NONE dis=NONE) header.from=ibm.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229658AbiKUSYx (ORCPT + 92 others); Mon, 21 Nov 2022 13:24:53 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:38240 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S229489AbiKUSYw (ORCPT ); Mon, 21 Nov 2022 13:24:52 -0500 Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5E9B2CDFD1; Mon, 21 Nov 2022 10:24:51 -0800 (PST) Received: from pps.filterd (m0098419.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.17.1.19/8.17.1.19) with ESMTP id 2ALGRpHi009307; Mon, 21 Nov 2022 18:24:07 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=AMtjW6WLFCULVG/XV+qA98xsr1zwM1JGCHIM1oBMy+g=; b=mesbrjG7UOwJd7gfx3lnVVoiKpNXvsmwJ/RBuN0mXq8l2ewijI2edu2Crwk0wOW1pXRE /EbPdnKf9pY2DxX1olRVe95iqd1KZqwHDMdR9+0IlQWHUnDSQmtKj8lSYltYLl7eEEyn tRyYAeIUjVXiVbpE+coLm+7kIFrr1vYl5/vydFmJOdtxBPHJIlV4bwH4OC84Dg7JSxEq 800ikAO4lIhdEleiJk4iGS0HT/KEDRxLyrIkXnw4JQzRvpVzvr6gqCR3PPGjIgyoDI3A WqdRGq6sw/5VAy8CwG1MJNqnehKiOmUz+OGxxlfIT5MygeHKi2/9iFLUC3UlEfLPe77o eg== Received: from pps.reinject (localhost [127.0.0.1]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3m0cvg2ky4-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 18:24:07 +0000 Received: from m0098419.ppops.net (m0098419.ppops.net [127.0.0.1]) by pps.reinject (8.17.1.5/8.17.1.5) with ESMTP id 2ALGWIXc028182; Mon, 21 Nov 2022 18:24:07 GMT Received: from ppma01wdc.us.ibm.com (fd.55.37a9.ip4.static.sl-reverse.com [169.55.85.253]) by mx0b-001b2d01.pphosted.com (PPS) with ESMTPS id 3m0cvg2kxw-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 18:24:07 +0000 Received: from pps.filterd (ppma01wdc.us.ibm.com [127.0.0.1]) by ppma01wdc.us.ibm.com (8.16.1.2/8.16.1.2) with SMTP id 2ALIL5h1016971; Mon, 21 Nov 2022 18:24:06 GMT Received: from b01cxnp22035.gho.pok.ibm.com (b01cxnp22035.gho.pok.ibm.com [9.57.198.25]) by ppma01wdc.us.ibm.com with ESMTP id 3kxps970cs-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT); Mon, 21 Nov 2022 18:24:06 +0000 Received: from smtpav03.wdc07v.mail.ibm.com ([9.208.128.112]) by b01cxnp22035.gho.pok.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id 2ALIO5TQ8717046 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Mon, 21 Nov 2022 18:24:05 GMT Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id 352B458054; Mon, 21 Nov 2022 18:24:05 +0000 (GMT) Received: from smtpav03.wdc07v.mail.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D2C155805C; Mon, 21 Nov 2022 18:24:03 +0000 (GMT) Received: from sig-9-65-226-3.ibm.com (unknown [9.65.226.3]) by smtpav03.wdc07v.mail.ibm.com (Postfix) with ESMTP; Mon, 21 Nov 2022 18:24:03 +0000 (GMT) Message-ID: <5d98172d77a8a0f1e3daab44ad51bf38978cc053.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 , kexec@lists.infradead.org Cc: Matthew Garrett , Jiri Bohac , David Howells , linux-integrity@vger.kernel.org, Eric Biederman , James Morris , Matthew Garrett , open list Date: Mon, 21 Nov 2022 13:23:57 -0500 In-Reply-To: <20221121072947.836672-1-coxu@redhat.com> References: <20221121072947.836672-1-coxu@redhat.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.28.5 (3.28.5-18.el8) Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-TM-AS-GCONF: 00 X-Proofpoint-GUID: 3bqLPIylRMF8WNuVop5Oo8wkFbGC0ndk X-Proofpoint-ORIG-GUID: myQEqmbxYN6708CMzE6cOpu7wWalPzdx 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-21_16,2022-11-18_01,2022-06-22_01 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 lowpriorityscore=0 bulkscore=0 phishscore=0 malwarescore=0 impostorscore=0 mlxscore=0 clxscore=1011 priorityscore=1501 suspectscore=0 spamscore=0 mlxlogscore=905 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.12.0-2210170000 definitions=main-2211210139 X-Spam-Status: No, score=-2.0 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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(), Reviewed-by: Mimi Zohar