From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from terminus.zytor.com ([2001:1868:205::10] helo=mail.zytor.com) by merlin.infradead.org with esmtps (Exim 4.80.1 #2 (Red Hat Linux)) id 1Vg4Xe-0001TJ-Dv for kexec@lists.infradead.org; Tue, 12 Nov 2013 03:21:27 +0000 Message-ID: <52819E71.70201@zytor.com> Date: Mon, 11 Nov 2013 19:20:17 -0800 From: "H. Peter Anvin" MIME-Version: 1.0 Subject: Re: [patch 1/3 v2] Add function get_bootparam References: <20131105082947.500512312@dhcp-16-126.nay.redhat.com> <20131105083428.411624560@dhcp-16-126.nay.redhat.com> <1384219658.1847.84.camel@misato.fc.hp.com> In-Reply-To: <1384219658.1847.84.camel@misato.fc.hp.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=twosheds.infradead.org@lists.infradead.org To: Toshi Kani , dyoung@redhat.com Cc: mjg59@srcf.ucam.org, linux-efi@vger.kernel.org, Greg KH , x86@kernel.org, kexec@lists.infradead.org, James.Bottomley@HansenPartnership.com, horms@verge.net.au, bp@alien8.de, ebiederm@xmission.com, Ingo Molnar , vgoyal@redhat.com On 11/11/2013 05:27 PM, Toshi Kani wrote: > On Tue, 2013-11-05 at 16:29 +0800, dyoung@redhat.com wrote: >> Not only setup_subarch will get data from debugfs file >> boot_params/data, later code for adding efi_info will >> also need do same thing. Thus add a common function here >> for later use. > > get_bootparam() calls find_mnt_by_fsname("debugfs"), which assumes that > debugfs is mounted with device name "debugfs". This function fails > when: > - debugfs is not mounted, or > - debugfs is mounted with a different device name, such as nodev [1]. > > This issue is not introduced by this patch. But the original code, > which sets hardware_subarch, seems to work even if it failed to access > debugfs (which is ignored) since hardware_subarch is zero most of the > cases anyway. With this change, however, this failure now makes the 2nd > kernel unbootable. So, it needs to be addressed to make this code path > work reliably (or kexec should fail at least). > Greg, Ingo, Since there is now a legitimate user of this stuff, can we actually export this in sysfs (or something else other than sploit^Wdebugfs)? kexec-tools can have a fallback to debugfs if we really need it, but making people mount debugfs to have some essential piece of functionality scares the heck out of me. -hpa _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec From mboxrd@z Thu Jan 1 00:00:00 1970 From: "H. Peter Anvin" Subject: Re: [patch 1/3 v2] Add function get_bootparam Date: Mon, 11 Nov 2013 19:20:17 -0800 Message-ID: <52819E71.70201@zytor.com> References: <20131105082947.500512312@dhcp-16-126.nay.redhat.com> <20131105083428.411624560@dhcp-16-126.nay.redhat.com> <1384219658.1847.84.camel@misato.fc.hp.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Return-path: In-Reply-To: <1384219658.1847.84.camel-RbGIw1UOYPVo/CpIj0byZw@public.gmane.org> List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "kexec" Errors-To: kexec-bounces+glkk-kexec=m.gmane.org-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org To: Toshi Kani , dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org Cc: mjg59-1xO5oi07KQx4cg9Nei1l7Q@public.gmane.org, linux-efi-u79uwXL29TY76Z2rM5mHXA@public.gmane.org, Greg KH , x86-DgEjT+Ai2ygdnm+yROfE0A@public.gmane.org, kexec-IAPFreCvJWM7uuMidbF8XUB+6BGkLq7r@public.gmane.org, James.Bottomley-d9PhHud1JfjCXq6kfMZ53/egYHeGw8Jk@public.gmane.org, horms-/R6kz+dDXgpPR4JQBCEnsQ@public.gmane.org, bp-Gina5bIWoIWzQB+pC5nmwQ@public.gmane.org, ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org, Ingo Molnar , vgoyal-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org List-Id: linux-efi@vger.kernel.org On 11/11/2013 05:27 PM, Toshi Kani wrote: > On Tue, 2013-11-05 at 16:29 +0800, dyoung-H+wXaHxf7aLQT0dZR+AlfA@public.gmane.org wrote: >> Not only setup_subarch will get data from debugfs file >> boot_params/data, later code for adding efi_info will >> also need do same thing. Thus add a common function here >> for later use. > > get_bootparam() calls find_mnt_by_fsname("debugfs"), which assumes that > debugfs is mounted with device name "debugfs". This function fails > when: > - debugfs is not mounted, or > - debugfs is mounted with a different device name, such as nodev [1]. > > This issue is not introduced by this patch. But the original code, > which sets hardware_subarch, seems to work even if it failed to access > debugfs (which is ignored) since hardware_subarch is zero most of the > cases anyway. With this change, however, this failure now makes the 2nd > kernel unbootable. So, it needs to be addressed to make this code path > work reliably (or kexec should fail at least). > Greg, Ingo, Since there is now a legitimate user of this stuff, can we actually export this in sysfs (or something else other than sploit^Wdebugfs)? kexec-tools can have a fallback to debugfs if we really need it, but making people mount debugfs to have some essential piece of functionality scares the heck out of me. -hpa