Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751243AbbG2JiI (ORCPT ); Wed, 29 Jul 2015 05:38:08 -0400 Received: from mx1.redhat.com ([209.132.183.28]:53247 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1750741AbbG2JiE (ORCPT ); Wed, 29 Jul 2015 05:38:04 -0400 Date: Wed, 29 Jul 2015 17:37:52 +0800 From: Dave Young To: Sebastian Andrzej Siewior Cc: josh@joshtriplett.org, Matt Fleming , Matt Fleming , x86@kernel.org, linux-efi@vger.kernel.org, linux-kernel@vger.kernel.org Subject: Re: [PATCH] x86/mm, efi: Check for valid image type Message-ID: <20150729093752.GF31695@dhcp-128-89.nay.redhat.com> References: <1437579164-20176-1-git-send-email-bigeasy@linutronix.de> <20150728205157.GD2773@codeblueprint.co.uk> <20150729001034.GD8671@cloud> <55B88F3B.2000902@linutronix.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <55B88F3B.2000902@linutronix.de> User-Agent: Mutt/1.5.22.1-rc1 (2013-10-16) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1162 Lines: 30 Hi, > > > As you pointed out above, a wild pointer could cause a > > WARN from early_ioremap. We need to never follow the pointer in the > > first place after a kexec, unless we have some way to know that it's > > actually valid. > > So you assume that the information from ACPI is always correct then? > The pointer is correct, the information it points to is no longer. > > If we run always under EFI then it looks like the variable efi_setup > which is checked in efi_enter_virtual_mode() is 0 during normal boot > and != 0 on kexec entry. This hint is set via setup_data / SETUP_EFI > since commit 1fec053369 ("x86/efi: Pass necessary EFI data for kexec > via setup_data"). So maybe we could use this to check if we run under > kexec or not. Not sure if BGRT is useful in kexec kernel, it seems not worth to copy it between kernels. IMO just return in case if (efi_setup) is true make sense. Thanks Dave -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/