Received: by 2002:ac0:a5a7:0:0:0:0:0 with SMTP id m36-v6csp1615417imm; Wed, 8 Aug 2018 22:08:36 -0700 (PDT) X-Google-Smtp-Source: AA+uWPyMJU8Rf0CU3LTHR3G2M2c5UaKXzggrO3IaAY0HXfN0rVd0ZnUxpR4NR/mVfQqqOvZHofNi X-Received: by 2002:a17:902:8bc4:: with SMTP id r4-v6mr590320plo.257.1533791316418; Wed, 08 Aug 2018 22:08:36 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1533791316; cv=none; d=google.com; s=arc-20160816; b=G4dvz0g9Fy9M8Lk1/ORJ1Yx/5lTnpnPfI73Gp//T9bnigUGs3GpLyBGqwixhJ8fKtR mqzqjrp4pj8UCCl6cJZ0fvxgyO7COgZMYB5IDtEJDY5UmU0w7eZo/GfnYqYSBzcoWCHR 4Q09BSgiz66FxuvvJF9XjGv3CoFK/I2emIWKnXPCXUEx1f/CAmlOoL0pYK2BKLkSj8Cs +9oP4h153GWiGA80S3ykQ+Va57/l+4uU+FYQRe9cvwimzJ0+6u7J8rqbkQob1M79ULnn xZpO1/2fXUTSTvl1GBr27uva3onsJ2zRCBLsURQu/mUZ9mwRJCrNldDtSGuXH255YFW1 S9+w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id :arc-authentication-results; bh=OimFER8od2DT3Sjuw0OEFx9iRJ33qlUA0D0ywNWbrTI=; b=uPAnEYKDXu6Q8EzOmwXtvaV8jLOge5evQqqvo/X2udKI+Sdhd+iDmgHVRrfAtnGqKD EuY9JbfKSY1E5nVfFrXlGj8BPr3qMf405aEBIbH1CeRgAvcORt0NPVPhKLNUpjXuywl2 TcWBLmX+JaQnFdQD5atagKKS5wNsMZy736YtsY+C8bYDZrbn7e1W0oVGouMxCvuTmgzf iMHYMBONZBo4Sw96j8mSHGl5TiV9MJsJq9BM4HSW49n4+VUJqSpxW2TbkKthlN+56f99 irVdLgfokixoOHf94mscKDqBhzw5ZSjEWztai+Pgr6Jti+1/74M6GWf9dNGSP9SJ5qkw J9WQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id w19-v6si5647900pfn.160.2018.08.08.22.08.22; Wed, 08 Aug 2018 22:08:36 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728306AbeHIH2l (ORCPT + 99 others); Thu, 9 Aug 2018 03:28:41 -0400 Received: from mout.gmx.net ([212.227.15.15]:43467 "EHLO mout.gmx.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727724AbeHIH2l (ORCPT ); Thu, 9 Aug 2018 03:28:41 -0400 Received: from homer.simpson.net ([185.221.149.218]) by mail.gmx.com (mrgmx002 [212.227.17.190]) with ESMTPSA (Nemesis) id 0LtaDM-1fxMUx3u8i-010wAP; Thu, 09 Aug 2018 07:05:16 +0200 Message-ID: <1533791114.5087.30.camel@gmx.de> Subject: Re: [PATCH] x86, kdump: Fix efi=noruntime NULL pointer dereference From: Mike Galbraith To: Dave Young Cc: Baoquan He , Sebastian Andrzej Siewior , lkml , kexec@lists.infradead.org Date: Thu, 09 Aug 2018 07:05:14 +0200 In-Reply-To: <20180809042153.GA4377@dhcp-128-65.nay.redhat.com> References: <1533737025.4936.3.camel@gmx.de> <20180809042153.GA4377@dhcp-128-65.nay.redhat.com> Content-Type: text/plain; charset="ISO-8859-15" X-Mailer: Evolution 3.26.6 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit X-Provags-ID: V03:K1:1yp/ASSm6nTu2rWP629uGUQQFx4l1owWvoViAV30T98fpFXpnpd 2tUuM9gbPkxbG1LU1fxTkGNX5Ho+eu6FZca5lY+Dtz/KxxEp56fP2VjiItstGeblMFLS2kC KSRv/SigpYquBg/zDETRwoUkIJQ7A7iKYJyRpuqEA53M1lImTK+Pf0hoiEmgl7BAfG2S3gU JgW7HDpNMOJjbQGFEyAiA== X-UI-Out-Filterresults: notjunk:1;V01:K0:nDcStL7hP3Y=:pIf59da96Rgg+TL5b7Ly5U hnrLXz7O/jWJ4X57ZCaUt2pB13suk29L1b99d2vhyyBRcs8aQOvjOnnVqwTTZKfvtxnWdVotp ZRDCXA20A76zKlMrnPcq+mjE3Y1KYCTBMCwfTdy33ZEMqNY/4y7nIUT5QhcVrK11NGSmptJNS JuTOjNc9y3SWDWHtaqHIrcZ4MoFr3qJNbCfHqmYvFfA6vv8FrqFzxvj2kGx8SNmn43nKkcx6s FWLswjZLi3AsgXfIph4vjvXgk3v6SdoAQnCyKKlV+hWkez3FosvEk7mXp3kBrZMpIJBbDCi63 PBqoT2TwtWVA7sEphB0Vu3QMg8rYVKNGFobSQqkPpjmCwPQpTa9uS5mdgcjyh1e/YSWMx3Vy3 BMKB8c9ASDFys22sNVjoJb4RfF5K9zp94BEnrGCwCr8jlV+hGRI3Rs1M32U5E6Udg3Lgn/Z2W GXy7UCl/i925IE3Z5Jc/LkWrIrpxtizyssDBtsRLocRgq9fjlfz7mS8pddYJwVcpCdCXrUPxx 2EbL0OT71+sSRdac8kbPCgHl2MYxnhCshQZ639fZq8eadR13TUhiER4KzvtNaslsPbmGw5WEN teU5RjnqBxKYDn0291XfalJRh2+ojZ0pQMO+nLITCn7EwtiIsZ9T4vMr0OUv3Jthio/23wm4v 02n0nb0PueqzXt5z6x9bkTHeef7K4/awpLbnEAhLv9csz6hUaaOBhLWgdhyWfrQAmw7K/K93p bjF0daeKbOIiyQQ8HCVUPESAOWfxYvl8kxlSmfYgI/4LeiqQD7kz1vDLxZmaJsP6epeDaGSBL x6Ah4Bn Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-08-09 at 12:21 +0800, Dave Young wrote: > Hi Mike, > > Thanks for the patch! > On 08/08/18 at 04:03pm, Mike Galbraith wrote: > > When booting with efi=noruntime, we call efi_runtime_map_copy() while > > loading the kdump kernel, and trip over a NULL efi.memmap.map. Avoid > > that and a useless allocation when the only mapping we can use (1:1) > > is not available. > > At first glance, efi_get_runtime_map_size should return 0 in case > noruntime. I actually made it do that in a separate patch first, and keyed on that in a second, but then decided to not notice anything odd in efi land (run Forest run!), and just fix the bug that now bites latest RT due to it turning efi runtime off by default. > Also since we are here, would you mind to restructure the bzImage64_load > function, and try to move all efi related code to setup_efi_state()? > > > setup_boot_parameters(struct kimage *image, struct boot_params *params, > unsigned long params_load_addr, > unsigned int efi_map_offset, unsigned int efi_map_sz, > unsigned int efi_setup_data_offset) > { > [snip] > > #ifdef CONFIG_EFI > /* Setup EFI state */ > setup_efi_state(params, params_load_addr, efi_map_offset, efi_map_sz, > efi_setup_data_offset); > #endif > > [snip] > } > > Currently bzImage64_load prepares the efi_map_offset, efi_map_sz, > and efi_setup_data_offset and then pass it to setup_boot_parameters and > setup_efi_state. It should be better to move those efi_* variables to > setup_efi_state(). > > So we can call setup_efi_state only when efi runtime is enabled. Yeah, I thought the same, but wanted to keep it dinky. -Mike