From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751220AbeECUkB (ORCPT ); Thu, 3 May 2018 16:40:01 -0400 Received: from mail-it0-f67.google.com ([209.85.214.67]:53525 "EHLO mail-it0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750962AbeECUj7 (ORCPT ); Thu, 3 May 2018 16:39:59 -0400 X-Google-Smtp-Source: AB8JxZq7/Ugig/JFrBa9SM/e6QL1Dl5Ut8QHuOSj8n5RQHUV70G+ALzXzMGbZxvewaEzXaup3Hata8cHNMVpZ8W777I= MIME-Version: 1.0 References: <1523572911-16363-1-git-send-email-zohar@linux.vnet.ibm.com> <87r2mso5up.fsf@xmission.com> In-Reply-To: <87r2mso5up.fsf@xmission.com> From: Matthew Garrett Date: Thu, 03 May 2018 20:39:48 +0000 Message-ID: Subject: Re: [PATCH 0/3] kexec: limit kexec_load syscall To: ebiederm@xmission.com Cc: Mimi Zohar , David Howells , linux-integrity , LSM List , kexec@lists.infradead.org, Linux Kernel Mailing List Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, May 3, 2018 at 1:13 PM Eric W. Biederman wrote: > Mimi Zohar writes: > > In environments that require the kexec kernel image to be signed, prevent > > using the kexec_load syscall. In order for LSMs and IMA to differentiate > > between kexec_load and kexec_file_load syscalls, this patch set adds a > > call to security_kernel_read_file() in kexec_load_check(). > Having thought about it some more this justification for these changes > does not work. The functionality of kexec_load is already root-only. > So in environments that require the kernel image to be signed just don't > use kexec_load. Possibly even compile kexec_load out to save space > because you will never need it. You don't need a new security hook to > do any of that. Userspace is a very fine mechanism for being the > instrument of policy. > If you don't trust userspace that needs to be spelled out very clearly. > You need to talk about what your threat models are. kexec_load gives root arbitrary power to modify the running kernel image, including the ability to disable enforcement of module signatures. Given that it weakens other security mechanisms that are designed to prevent root from disabling them, it makes sense to allow the imposition of an equivalent restriction. From mboxrd@z Thu Jan 1 00:00:00 1970 From: mjg59@google.com (Matthew Garrett) Date: Thu, 03 May 2018 20:39:48 +0000 Subject: [PATCH 0/3] kexec: limit kexec_load syscall In-Reply-To: <87r2mso5up.fsf@xmission.com> References: <1523572911-16363-1-git-send-email-zohar@linux.vnet.ibm.com> <87r2mso5up.fsf@xmission.com> Message-ID: To: linux-security-module@vger.kernel.org List-Id: linux-security-module.vger.kernel.org On Thu, May 3, 2018 at 1:13 PM Eric W. Biederman wrote: > Mimi Zohar writes: > > In environments that require the kexec kernel image to be signed, prevent > > using the kexec_load syscall. In order for LSMs and IMA to differentiate > > between kexec_load and kexec_file_load syscalls, this patch set adds a > > call to security_kernel_read_file() in kexec_load_check(). > Having thought about it some more this justification for these changes > does not work. The functionality of kexec_load is already root-only. > So in environments that require the kernel image to be signed just don't > use kexec_load. Possibly even compile kexec_load out to save space > because you will never need it. You don't need a new security hook to > do any of that. Userspace is a very fine mechanism for being the > instrument of policy. > If you don't trust userspace that needs to be spelled out very clearly. > You need to talk about what your threat models are. kexec_load gives root arbitrary power to modify the running kernel image, including the ability to disable enforcement of module signatures. Given that it weakens other security mechanisms that are designed to prevent root from disabling them, it makes sense to allow the imposition of an equivalent restriction. -- To unsubscribe from this list: send the line "unsubscribe linux-security-module" in the body of a message to majordomo at vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail-it0-x243.google.com ([2607:f8b0:4001:c0b::243]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1fEL1O-0008Ub-IH for kexec@lists.infradead.org; Thu, 03 May 2018 20:40:12 +0000 Received: by mail-it0-x243.google.com with SMTP id 144-v6so842118iti.5 for ; Thu, 03 May 2018 13:39:59 -0700 (PDT) MIME-Version: 1.0 References: <1523572911-16363-1-git-send-email-zohar@linux.vnet.ibm.com> <87r2mso5up.fsf@xmission.com> In-Reply-To: <87r2mso5up.fsf@xmission.com> From: Matthew Garrett Date: Thu, 03 May 2018 20:39:48 +0000 Message-ID: Subject: Re: [PATCH 0/3] kexec: limit kexec_load syscall 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: ebiederm@xmission.com Cc: kexec@lists.infradead.org, Linux Kernel Mailing List , David Howells , LSM List , linux-integrity , Mimi Zohar On Thu, May 3, 2018 at 1:13 PM Eric W. Biederman wrote: > Mimi Zohar writes: > > In environments that require the kexec kernel image to be signed, prevent > > using the kexec_load syscall. In order for LSMs and IMA to differentiate > > between kexec_load and kexec_file_load syscalls, this patch set adds a > > call to security_kernel_read_file() in kexec_load_check(). > Having thought about it some more this justification for these changes > does not work. The functionality of kexec_load is already root-only. > So in environments that require the kernel image to be signed just don't > use kexec_load. Possibly even compile kexec_load out to save space > because you will never need it. You don't need a new security hook to > do any of that. Userspace is a very fine mechanism for being the > instrument of policy. > If you don't trust userspace that needs to be spelled out very clearly. > You need to talk about what your threat models are. kexec_load gives root arbitrary power to modify the running kernel image, including the ability to disable enforcement of module signatures. Given that it weakens other security mechanisms that are designed to prevent root from disabling them, it makes sense to allow the imposition of an equivalent restriction. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec