From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S932401AbdJZPq6 (ORCPT ); Thu, 26 Oct 2017 11:46:58 -0400 Received: from mx0b-001b2d01.pphosted.com ([148.163.158.5]:51446 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-FAIL) by vger.kernel.org with ESMTP id S932365AbdJZPqy (ORCPT ); Thu, 26 Oct 2017 11:46:54 -0400 Subject: Re: [PATCH 07/27] kexec_file: Disable at runtime if securelevel has been set From: Mimi Zohar To: David Howells , joeyli Cc: linux-security-module@vger.kernel.org, gnomes@lxorguk.ukuu.org.uk, linux-efi@vger.kernel.org, gregkh@linuxfoundation.org, linux-kernel@vger.kernel.org, jforbes@redhat.com, Matthew Garrett Date: Thu, 26 Oct 2017 11:46:45 -0400 In-Reply-To: <26694.1509030144@warthog.procyon.org.uk> References: <20171026074243.GM8550@linux-l9pv.suse> <150842463163.7923.11081723749106843698.stgit@warthog.procyon.org.uk> <150842468754.7923.10037578333644594134.stgit@warthog.procyon.org.uk> <1508774083.3639.124.camel@linux.vnet.ibm.com> <26694.1509030144@warthog.procyon.org.uk> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.20.5 (3.20.5-1.fc24) Mime-Version: 1.0 Content-Transfer-Encoding: 8bit X-TM-AS-GCONF: 00 x-cbid: 17102615-0040-0000-0000-000004074370 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 17102615-0041-0000-0000-000020A9B93E Message-Id: <1509032805.5886.52.camel@linux.vnet.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:,, definitions=2017-10-26_05:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=3 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 impostorscore=0 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1707230000 definitions=main-1710260208 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Cc'ing Matthew Garrett] On Thu, 2017-10-26 at 16:02 +0100, David Howells wrote: > joeyli wrote: > > > + if (!IS_ENABLED(CONFIG_KEXEC_VERIFY_SIG) && > > + !is_ima_appraise_enabled() && > > + kernel_is_locked_down("kexec of unsigned images")) > > This doesn't seem right. It seems that you can then kexec unsigned images > into a locked-down kernel if IMA appraise is enabled. Huh?!  With the "secure_boot" policy enabled on the boot command line, IMA-appraisal would verify the kexec kernel image, firmware, kernel modules, and custom IMA policy signatures.  With the "ima: require secure_boot rules in lockdown mode" patch, the "lockdown" mode would enable IMA-appraisal's secure_boot policy, without requiring the boot command line option.  It would also add the secure_boot rules to the custom policy, so that if the builtin policy is replaced with a custom policy, the "secure_boot" policy would still be enforced. Other patches in this patch series need to be updated as well to check if IMA-appraisal is enabled. Mimi