From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1753866Ab3LJOjZ (ORCPT ); Tue, 10 Dec 2013 09:39:25 -0500 Received: from mx1.redhat.com ([209.132.183.28]:39712 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1753107Ab3LJOjV (ORCPT ); Tue, 10 Dec 2013 09:39:21 -0500 Date: Tue, 10 Dec 2013 09:38:28 -0500 From: Vivek Goyal To: Kees Cook Cc: "H. Peter Anvin" , LKML , Rik van Riel , Andrew Morton , Matthew Garrett , Rob Landley , Eric Biederman , Ingo Molnar , Peter Zijlstra , Mel Gorman , "linux-doc@vger.kernel.org" , kexec@lists.infradead.org Subject: Re: [PATCH v2] kexec: add sysctl to disable kexec Message-ID: <20131210143828.GB13909@redhat.com> References: <20131210001620.GA7938@www.outflux.net> <52A66190.9060907@zytor.com> <20131210143540.GA13909@redhat.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20131210143540.GA13909@redhat.com> User-Agent: Mutt/1.5.21 (2010-09-15) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Tue, Dec 10, 2013 at 09:35:40AM -0500, Vivek Goyal wrote: > On Mon, Dec 09, 2013 at 05:06:10PM -0800, Kees Cook wrote: > > On Mon, Dec 9, 2013 at 4:34 PM, H. Peter Anvin wrote: > > > On 12/09/2013 04:16 PM, Kees Cook wrote: > > >> For general-purpose (i.e. distro) kernel builds it makes sense to build with > > >> CONFIG_KEXEC to allow end users to choose what kind of things they want to do > > >> with kexec. However, in the face of trying to lock down a system with such > > >> a kernel, there needs to be a way to disable kexec (much like module loading > > >> can be disabled). Without this, it is too easy for the root user to modify > > >> kernel memory even when CONFIG_STRICT_DEVMEM and modules_disabled are set. > > >> > > >> Signed-off-by: Kees Cook > > >> Acked-by: Rik van Riel > > > > > > So the logic is to load a crashkernel and then lock down the machine > > > before services, networking etc. are enabled? > > > > Right, or to just turn it off at boot time if kexec will not be used at all. > > kdump kernel is loaded with the help of kdump service. Different distro's > might have different dependencies for that serivce. But recently in fedora > we wait network to come up before starting that service. (So that nfs > targets can be mounted and checked for valid dump destinations). > > IOW, crash kernel is loaded quite late in the game (quite a few services > have run and possibly networking is up too). To me, practically one will > disable kdump also if you change state of this knob early. Of course it also removes the possibility of re-loading crash kernel after doing some changes to /etc/kdump.conf (like dump destination or kernel command line). I am wondering if it is sufficient to disable kexec jump back functionality only while retaining kexec and kdump. That seems to be easiest way to change kernel's data structures. Thanks Vivek