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 X-Spam-Level: X-Spam-Status: No, score=-6.8 required=3.0 tests=HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH,MAILING_LIST_MULTI,SIGNED_OFF_BY,SPF_PASS,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7EC2C43382 for ; Thu, 27 Sep 2018 11:33:22 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [209.132.180.67]) by mail.kernel.org (Postfix) with ESMTP id 93F95215E4 for ; Thu, 27 Sep 2018 11:33:22 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 93F95215E4 Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=linux.ibm.com Authentication-Results: mail.kernel.org; spf=none smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727573AbeI0RvL (ORCPT ); Thu, 27 Sep 2018 13:51:11 -0400 Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]:41308 "EHLO mx0a-001b2d01.pphosted.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727262AbeI0RvK (ORCPT ); Thu, 27 Sep 2018 13:51:10 -0400 Received: from pps.filterd (m0098409.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8RBOVom092077 for ; Thu, 27 Sep 2018 07:33:19 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mrx798mms-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 27 Sep 2018 07:33:19 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 27 Sep 2018 12:33:16 +0100 Received: from b06cxnps3074.portsmouth.uk.ibm.com (9.149.109.194) by e06smtp04.uk.ibm.com (192.168.101.134) with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted; (version=TLSv1/SSLv3 cipher=AES256-GCM-SHA384 bits=256/256) Thu, 27 Sep 2018 12:33:14 +0100 Received: from d06av26.portsmouth.uk.ibm.com (d06av26.portsmouth.uk.ibm.com [9.149.105.62]) by b06cxnps3074.portsmouth.uk.ibm.com (8.14.9/8.14.9/NCO v10.0) with ESMTP id w8RBXDW167043464 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=FAIL); Thu, 27 Sep 2018 11:33:13 GMT Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id E456AAE058; Thu, 27 Sep 2018 14:32:11 +0100 (BST) Received: from d06av26.portsmouth.uk.ibm.com (unknown [127.0.0.1]) by IMSVA (Postfix) with ESMTP id D8956AE059; Thu, 27 Sep 2018 14:32:10 +0100 (BST) Received: from localhost.localdomain (unknown [9.80.85.160]) by d06av26.portsmouth.uk.ibm.com (Postfix) with ESMTP; Thu, 27 Sep 2018 14:32:10 +0100 (BST) Subject: Re: [PATCH v4 1/6] x86/ima: define arch_ima_get_secureboot From: Mimi Zohar To: Nayna Jain , linux-integrity@vger.kernel.org Cc: linux-security-module@vger.kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org, dhowells@redhat.com, jforbes@redhat.com, Seth Forshee , kexec Date: Thu, 27 Sep 2018 07:33:01 -0400 In-Reply-To: <20180926122210.14642-2-nayna@linux.vnet.ibm.com> References: <20180926122210.14642-1-nayna@linux.vnet.ibm.com> <20180926122210.14642-2-nayna@linux.vnet.ibm.com> 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: 7bit X-TM-AS-GCONF: 00 x-cbid: 18092711-0016-0000-0000-0000020B4AD4 X-IBM-AV-DETECTION: SAVI=unused REMOTE=unused XFE=unused x-cbparentid: 18092711-0017-0000-0000-000032627045 Message-Id: <1538047981.3459.74.camel@linux.ibm.com> X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:,, definitions=2018-09-27_06:,, signatures=0 X-Proofpoint-Spam-Details: rule=outbound_notspam policy=outbound score=0 priorityscore=1501 malwarescore=0 suspectscore=0 phishscore=0 bulkscore=0 spamscore=0 clxscore=1015 lowpriorityscore=0 mlxscore=0 impostorscore=0 mlxlogscore=999 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809270115 Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org [Cc'ing the kexec mailing list, and Seth] On Wed, 2018-09-26 at 17:52 +0530, Nayna Jain wrote: > Distros are concerned about totally disabling the kexec_load syscall. > As a compromise, the kexec_load syscall will only be disabled when > CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with > secureboot enabled. > > This patch defines the new arch specific function called > arch_ima_get_secureboot() to retrieve the secureboot state of the system. > > Signed-off-by: Nayna Jain > Suggested-by: Seth Forshee Nice! Mimi > --- > arch/x86/kernel/Makefile | 2 ++ > arch/x86/kernel/ima_arch.c | 17 +++++++++++++++++ > include/linux/ima.h | 9 +++++++++ > 3 files changed, 28 insertions(+) > create mode 100644 arch/x86/kernel/ima_arch.c > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > index 02d6f5cf4e70..f32406e51424 100644 > --- a/arch/x86/kernel/Makefile > +++ b/arch/x86/kernel/Makefile > @@ -149,3 +149,5 @@ ifeq ($(CONFIG_X86_64),y) > obj-$(CONFIG_MMCONF_FAM10H) += mmconf-fam10h_64.o > obj-y += vsmp_64.o > endif > + > +obj-$(CONFIG_IMA) += ima_arch.o > diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c > new file mode 100644 > index 000000000000..bb5a88d2b271 > --- /dev/null > +++ b/arch/x86/kernel/ima_arch.c > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * Copyright (C) 2018 IBM Corporation > + */ > +#include > +#include > + > +extern struct boot_params boot_params; > + > +bool arch_ima_get_secureboot(void) > +{ > + if (efi_enabled(EFI_BOOT) && > + (boot_params.secure_boot == efi_secureboot_mode_enabled)) > + return true; > + else > + return false; > +} > diff --git a/include/linux/ima.h b/include/linux/ima.h > index 84806b54b50a..4852255aa4f4 100644 > --- a/include/linux/ima.h > +++ b/include/linux/ima.h > @@ -30,6 +30,15 @@ extern void ima_post_path_mknod(struct dentry *dentry); > extern void ima_add_kexec_buffer(struct kimage *image); > #endif > > +#ifdef CONFIG_X86 > +extern bool arch_ima_get_secureboot(void); > +#else > +static inline bool arch_ima_get_secureboot(void) > +{ > + return false; > +} > +#endif > + > #else > static inline int ima_bprm_check(struct linux_binprm *bprm) > { From mboxrd@z Thu Jan 1 00:00:00 1970 From: zohar@linux.ibm.com (Mimi Zohar) Date: Thu, 27 Sep 2018 07:33:01 -0400 Subject: [PATCH v4 1/6] x86/ima: define arch_ima_get_secureboot In-Reply-To: <20180926122210.14642-2-nayna@linux.vnet.ibm.com> References: <20180926122210.14642-1-nayna@linux.vnet.ibm.com> <20180926122210.14642-2-nayna@linux.vnet.ibm.com> Message-ID: <1538047981.3459.74.camel@linux.ibm.com> To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org [Cc'ing the kexec mailing list, and Seth] On Wed, 2018-09-26 at 17:52 +0530, Nayna Jain wrote: > Distros are concerned about totally disabling the kexec_load syscall. > As a compromise, the kexec_load syscall will only be disabled when > CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with > secureboot enabled. > > This patch defines the new arch specific function called > arch_ima_get_secureboot() to retrieve the secureboot state of the system. > > Signed-off-by: Nayna Jain > Suggested-by: Seth Forshee Nice! Mimi > --- > arch/x86/kernel/Makefile | 2 ++ > arch/x86/kernel/ima_arch.c | 17 +++++++++++++++++ > include/linux/ima.h | 9 +++++++++ > 3 files changed, 28 insertions(+) > create mode 100644 arch/x86/kernel/ima_arch.c > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > index 02d6f5cf4e70..f32406e51424 100644 > --- a/arch/x86/kernel/Makefile > +++ b/arch/x86/kernel/Makefile > @@ -149,3 +149,5 @@ ifeq ($(CONFIG_X86_64),y) > obj-$(CONFIG_MMCONF_FAM10H) += mmconf-fam10h_64.o > obj-y += vsmp_64.o > endif > + > +obj-$(CONFIG_IMA) += ima_arch.o > diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c > new file mode 100644 > index 000000000000..bb5a88d2b271 > --- /dev/null > +++ b/arch/x86/kernel/ima_arch.c > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * Copyright (C) 2018 IBM Corporation > + */ > +#include > +#include > + > +extern struct boot_params boot_params; > + > +bool arch_ima_get_secureboot(void) > +{ > + if (efi_enabled(EFI_BOOT) && > + (boot_params.secure_boot == efi_secureboot_mode_enabled)) > + return true; > + else > + return false; > +} > diff --git a/include/linux/ima.h b/include/linux/ima.h > index 84806b54b50a..4852255aa4f4 100644 > --- a/include/linux/ima.h > +++ b/include/linux/ima.h > @@ -30,6 +30,15 @@ extern void ima_post_path_mknod(struct dentry *dentry); > extern void ima_add_kexec_buffer(struct kimage *image); > #endif > > +#ifdef CONFIG_X86 > +extern bool arch_ima_get_secureboot(void); > +#else > +static inline bool arch_ima_get_secureboot(void) > +{ > + return false; > +} > +#endif > + > #else > static inline int ima_bprm_check(struct linux_binprm *bprm) > { From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mx0a-001b2d01.pphosted.com ([148.163.156.1]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1g5UYM-0002Fq-9P for kexec@lists.infradead.org; Thu, 27 Sep 2018 11:33:56 +0000 Received: from pps.filterd (m0098410.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.22/8.16.0.22) with SMTP id w8RBRe6k058990 for ; Thu, 27 Sep 2018 07:33:21 -0400 Received: from e06smtp04.uk.ibm.com (e06smtp04.uk.ibm.com [195.75.94.100]) by mx0a-001b2d01.pphosted.com with ESMTP id 2mrwh1tq06-1 (version=TLSv1.2 cipher=AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 27 Sep 2018 07:33:19 -0400 Received: from localhost by e06smtp04.uk.ibm.com with IBM ESMTP SMTP Gateway: Authorized Use Only! Violators will be prosecuted for from ; Thu, 27 Sep 2018 12:33:16 +0100 Subject: Re: [PATCH v4 1/6] x86/ima: define arch_ima_get_secureboot From: Mimi Zohar Date: Thu, 27 Sep 2018 07:33:01 -0400 In-Reply-To: <20180926122210.14642-2-nayna@linux.vnet.ibm.com> References: <20180926122210.14642-1-nayna@linux.vnet.ibm.com> <20180926122210.14642-2-nayna@linux.vnet.ibm.com> Mime-Version: 1.0 Message-Id: <1538047981.3459.74.camel@linux.ibm.com> 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+dwmw2=infradead.org@lists.infradead.org To: Nayna Jain , linux-integrity@vger.kernel.org Cc: linux-efi@vger.kernel.org, kexec , linux-kernel@vger.kernel.org, dhowells@redhat.com, Seth Forshee , linux-security-module@vger.kernel.org, jforbes@redhat.com [Cc'ing the kexec mailing list, and Seth] On Wed, 2018-09-26 at 17:52 +0530, Nayna Jain wrote: > Distros are concerned about totally disabling the kexec_load syscall. > As a compromise, the kexec_load syscall will only be disabled when > CONFIG_KEXEC_VERIFY_SIG is configured and the system is booted with > secureboot enabled. > > This patch defines the new arch specific function called > arch_ima_get_secureboot() to retrieve the secureboot state of the system. > > Signed-off-by: Nayna Jain > Suggested-by: Seth Forshee Nice! Mimi > --- > arch/x86/kernel/Makefile | 2 ++ > arch/x86/kernel/ima_arch.c | 17 +++++++++++++++++ > include/linux/ima.h | 9 +++++++++ > 3 files changed, 28 insertions(+) > create mode 100644 arch/x86/kernel/ima_arch.c > > diff --git a/arch/x86/kernel/Makefile b/arch/x86/kernel/Makefile > index 02d6f5cf4e70..f32406e51424 100644 > --- a/arch/x86/kernel/Makefile > +++ b/arch/x86/kernel/Makefile > @@ -149,3 +149,5 @@ ifeq ($(CONFIG_X86_64),y) > obj-$(CONFIG_MMCONF_FAM10H) += mmconf-fam10h_64.o > obj-y += vsmp_64.o > endif > + > +obj-$(CONFIG_IMA) += ima_arch.o > diff --git a/arch/x86/kernel/ima_arch.c b/arch/x86/kernel/ima_arch.c > new file mode 100644 > index 000000000000..bb5a88d2b271 > --- /dev/null > +++ b/arch/x86/kernel/ima_arch.c > @@ -0,0 +1,17 @@ > +/* SPDX-License-Identifier: GPL-2.0+ */ > +/* > + * Copyright (C) 2018 IBM Corporation > + */ > +#include > +#include > + > +extern struct boot_params boot_params; > + > +bool arch_ima_get_secureboot(void) > +{ > + if (efi_enabled(EFI_BOOT) && > + (boot_params.secure_boot == efi_secureboot_mode_enabled)) > + return true; > + else > + return false; > +} > diff --git a/include/linux/ima.h b/include/linux/ima.h > index 84806b54b50a..4852255aa4f4 100644 > --- a/include/linux/ima.h > +++ b/include/linux/ima.h > @@ -30,6 +30,15 @@ extern void ima_post_path_mknod(struct dentry *dentry); > extern void ima_add_kexec_buffer(struct kimage *image); > #endif > > +#ifdef CONFIG_X86 > +extern bool arch_ima_get_secureboot(void); > +#else > +static inline bool arch_ima_get_secureboot(void) > +{ > + return false; > +} > +#endif > + > #else > static inline int ima_bprm_check(struct linux_binprm *bprm) > { _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec