From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754523AbcLORxr (ORCPT ); Thu, 15 Dec 2016 12:53:47 -0500 Received: from out02.mta.xmission.com ([166.70.13.232]:38136 "EHLO out02.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754438AbcLORxo (ORCPT ); Thu, 15 Dec 2016 12:53:44 -0500 From: ebiederm@xmission.com (Eric W. Biederman) To: Thomas Garnier Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Andrew Morton , Baoquan He , Xunlei Pang , HATAYAMA Daisuke , x86@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, kernel-hardening@lists.openwall.com References: <1481818648-36201-1-git-send-email-thgarnie@google.com> Date: Fri, 16 Dec 2016 06:50:31 +1300 In-Reply-To: <1481818648-36201-1-git-send-email-thgarnie@google.com> (Thomas Garnier's message of "Thu, 15 Dec 2016 08:17:28 -0800") Message-ID: <87bmwdytco.fsf@xmission.com> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/25.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain X-XM-SPF: eid=1cHaDo-0003sL-RX;;;mid=<87bmwdytco.fsf@xmission.com>;;;hst=in01.mta.xmission.com;;;ip=101.100.131.98;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX192SYAI8D4gHjff9FK0O5AbKCzsyTs/OA8= X-SA-Exim-Connect-IP: 101.100.131.98 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.7 XMSubLong Long Subject * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa06 1397; Body=1 Fuz1=1 Fuz2=1] * 1.0 XM_Sft_Co_L33T No description available. X-Spam-DCC: XMission; sa06 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: *;Thomas Garnier X-Spam-Relay-Country: X-Spam-Timing: total 5537 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 3.1 (0.1%), b_tie_ro: 2.1 (0.0%), parse: 0.74 (0.0%), extract_message_metadata: 11 (0.2%), get_uri_detail_list: 1.58 (0.0%), tests_pri_-1000: 6 (0.1%), tests_pri_-950: 1.14 (0.0%), tests_pri_-900: 0.97 (0.0%), tests_pri_-400: 23 (0.4%), check_bayes: 22 (0.4%), b_tokenize: 7 (0.1%), b_tok_get_all: 7 (0.1%), b_comp_prob: 1.85 (0.0%), b_tok_touch_all: 2.9 (0.1%), b_finish: 0.66 (0.0%), tests_pri_0: 365 (6.6%), check_dkim_signature: 0.50 (0.0%), check_dkim_adsp: 2.7 (0.0%), tests_pri_500: 5125 (92.6%), poll_dns_idle: 5120 (92.5%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH] Revert "Revert "kdump, vmcoreinfo: report memory sections virtual addresses"" X-Spam-Flag: No X-SA-Exim-Version: 4.2.1 (built Thu, 05 May 2016 13:38:54 -0600) X-SA-Exim-Scanned: Yes (on in01.mta.xmission.com) Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Thomas Garnier writes: > This reverts commit 49fd897573c97b0eaf10f47d850027d78c456cd7. > > Reverting back to commit 0549a3c because the values are used by crash > and other tools already. I expected this commit would not go through given > the unresolved comments. I want it to be easy to resolve major memory > section positions when KASLR memory randomization is enabled. This patch is broken. The commit referenced is wrong, as is the justification. These values are not in fact widely used by userspace (they are brand new). This is a very fragile approach relying on kernel implementation details, so if we can do anything else that is more robust it is much more likely to pass the test of time. And yes a more robust implementation has been already discussed. Nacked-by: "Eric W. Biederman" > > Signed-off-by: Thomas Garnier > --- > arch/x86/kernel/machine_kexec_64.c | 3 +++ > include/linux/kexec.h | 6 ++++++ > 2 files changed, 9 insertions(+) > > diff --git a/arch/x86/kernel/machine_kexec_64.c b/arch/x86/kernel/machine_kexec_64.c > index 2e3c34b..05f3367 100644 > --- a/arch/x86/kernel/machine_kexec_64.c > +++ b/arch/x86/kernel/machine_kexec_64.c > @@ -339,6 +339,9 @@ void arch_crash_save_vmcoreinfo(void) > kaslr_offset()); > VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE); > VMCOREINFO_PHYS_BASE(phys_base); > + VMCOREINFO_PAGE_OFFSET(PAGE_OFFSET); > + VMCOREINFO_VMALLOC_START(VMALLOC_START); > + VMCOREINFO_VMEMMAP_START(VMEMMAP_START); > } > > /* arch-dependent functionality related to kexec file-based syscall */ > diff --git a/include/linux/kexec.h b/include/linux/kexec.h > index e98e546..ff9c876 100644 > --- a/include/linux/kexec.h > +++ b/include/linux/kexec.h > @@ -285,6 +285,12 @@ phys_addr_t paddr_vmcoreinfo_note(void); > vmcoreinfo_append_str("CONFIG_%s=y\n", #name) > #define VMCOREINFO_PHYS_BASE(value) \ > vmcoreinfo_append_str("PHYS_BASE=%lx\n", (unsigned long)value) > +#define VMCOREINFO_PAGE_OFFSET(value) \ > + vmcoreinfo_append_str("PAGE_OFFSET=%lx\n", (unsigned long)value) > +#define VMCOREINFO_VMALLOC_START(value) \ > + vmcoreinfo_append_str("VMALLOC_START=%lx\n", (unsigned long)value) > +#define VMCOREINFO_VMEMMAP_START(value) \ > + vmcoreinfo_append_str("VMEMMAP_START=%lx\n", (unsigned long)value) > > extern struct kimage *kexec_image; > extern struct kimage *kexec_crash_image;