From mboxrd@z Thu Jan 1 00:00:00 1970 Return-path: Received: from mail.skyhub.de ([2a01:4f8:190:11c2::b:1457]) by bombadil.infradead.org with esmtps (Exim 4.90_1 #2 (Red Hat Linux)) id 1hEVDM-00076X-8k for kexec@lists.infradead.org; Thu, 11 Apr 2019 08:37:47 +0000 Date: Thu, 11 Apr 2019 10:37:38 +0200 From: Borislav Petkov Subject: Re: [PATCH v4] x86/boot: Use efi_setup_data for searching RSDP on kexec-ed kernel Message-ID: <20190411083738.GC30080@zn.tnic> References: <20190408231011.GA5402@jeru.linux.bs1.fc.nec.co.jp> <20190410171431.GE26580@zn.tnic> <7cbc096d-0548-18b1-a335-8ba114f234a7@ce.jp.nec.com> <20190411080927.GA30080@zn.tnic> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: 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: Junichi Nomura Cc: Chao Fan , Kairui Song , Baoquan He , "x86@kernel.org" , "kexec@lists.infradead.org" , "linux-kernel@vger.kernel.org" , Dave Young On Thu, Apr 11, 2019 at 08:16:45AM +0000, Junichi Nomura wrote: > kexec_get_rsdp_addr() might fail on kexec-booted kernel, e.g. if the > setup_data was invalid. In such a case, falling back to efi_get_rsdp_addr() > will hit the problem of accessing invalid table pointer again. Then you need to do this: if (kexeced kernel) { addr = kexec_get_rsdp_addr(); if (!addr) { /* cannot get address */ return -1; } return addr; } and the calling function get_rsdp_addr() must check the return value and if it is not 0, return immediately. -- Regards/Gruss, Boris. Good mailing practices for 400: avoid top-posting and trim the reply. _______________________________________________ kexec mailing list kexec@lists.infradead.org http://lists.infradead.org/mailman/listinfo/kexec