From patchwork Thu Dec 15 16:17:28 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Thomas Garnier X-Patchwork-Id: 9476495 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork.web.codeaurora.org (Postfix) with ESMTP id DB5DF6047D for ; Thu, 15 Dec 2016 16:18:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id C6E07287D1 for ; Thu, 15 Dec 2016 16:18:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id BA335287D8; Thu, 15 Dec 2016 16:18:19 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-4.1 required=2.0 tests=BAYES_00, DKIM_ADSP_CUSTOM_MED, DKIM_SIGNED, RCVD_IN_DNSWL_MED, T_DKIM_INVALID autolearn=ham version=3.3.1 Received: from mother.openwall.net (mother.openwall.net [195.42.179.200]) by mail.wl.linuxfoundation.org (Postfix) with SMTP id EBB02287D1 for ; Thu, 15 Dec 2016 16:18:18 +0000 (UTC) Received: (qmail 17679 invoked by uid 550); 15 Dec 2016 16:18:16 -0000 Mailing-List: contact kernel-hardening-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: kernel-hardening@lists.openwall.com Delivered-To: mailing list kernel-hardening@lists.openwall.com Received: (qmail 17661 invoked from network); 15 Dec 2016 16:18:16 -0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=from:to:cc:subject:date:message-id; bh=poBY+Arg+HfxtgU+VrnAmN48yNark7jzxQyoFcC3mBU=; b=HYZSrAgV+zUp7cH/We+KMKo+sfxr53ne7D3rAtLvgYYOxTbRT90qBMW7x/LMv6RWL5 a1J7lI8p7nBeXFt90r06aINwHYufqgR3yy51OfzEcVntySAWDk/c1dPmvr0AS8zi3V5r OesaUW9/NL5kkVia4v1VlCRtqayXJbb+lzlA6iDznfnbnA2a8XjhYKt8AQUt7Kt8Cu5d UOvA1RBO8tlYW2u1zVJpx9IKb4wvpswl23DnG+VgtqQleQJXwFkd1+RkJcBdVIN+hQJe kXSHogugTeM39ly4/zp2et8n18Iw3+MhdAkbKhMo7WLdnVQQDs7Os+4H363BuZzY+Yiz eWJw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id; bh=poBY+Arg+HfxtgU+VrnAmN48yNark7jzxQyoFcC3mBU=; b=cwjVTOpJY7KsyfXRP2PUjvxH0Q8Ym/HLlPlM+x/apIAxgxMNiOOZmCtefoApfszX62 2HvyeH4cbnzm69Nd1ofwOebK+Lz/iJahK2RhfAMb0FStWMm4WWpj5hlIexC7Yz+mLuvz GqBom7MyaPuItafaP25VUqFkbfplSJf4adT48QCeF2qx4SNXrUcjVpmIfG0ZZDWz9UaU ux3b6k95i2nAT9q0ML+6xi8wO+qNj+kGLIMnoA5Z6QP6pOZGa3w2uLbSILybTA78qPYX SllyxVN+3e+iOQWjevbWeVhJg6aJRcoIKxN5MUWxtrSp1JYe9KFlWj35oWaa66l7freo EMVA== X-Gm-Message-State: AKaTC0228IU0Cw4CyDfNQ8TEPAXGGG3oGkYi3xoDL0IR9hV8i916hNVPC5/LNs06LzsZNJ4m X-Received: by 10.84.217.143 with SMTP id p15mr3967717pli.77.1481818684425; Thu, 15 Dec 2016 08:18:04 -0800 (PST) From: Thomas Garnier To: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Eric Biederman , Andrew Morton , Baoquan He , Thomas Garnier , Xunlei Pang , HATAYAMA Daisuke Cc: x86@kernel.org, linux-kernel@vger.kernel.org, kexec@lists.infradead.org, kernel-hardening@lists.openwall.com Date: Thu, 15 Dec 2016 08:17:28 -0800 Message-Id: <1481818648-36201-1-git-send-email-thgarnie@google.com> X-Mailer: git-send-email 2.8.0.rc3.226.g39d4020 Subject: [kernel-hardening] [PATCH] Revert "Revert "kdump, vmcoreinfo: report memory sections virtual addresses"" X-Virus-Scanned: ClamAV using ClamSMTP 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. Signed-off-by: Thomas Garnier Nacked-by: "Eric W. Biederman" --- 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;