From patchwork Mon Aug 29 10:11:37 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Baoquan He X-Patchwork-Id: 9303419 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 56A6B607F0 for ; Mon, 29 Aug 2016 10:12:00 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 4796128799 for ; Mon, 29 Aug 2016 10:12:00 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 3C0C1287B0; Mon, 29 Aug 2016 10:12:00 +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.2 required=2.0 tests=BAYES_00, RCVD_IN_DNSWL_MED 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 4475628799 for ; Mon, 29 Aug 2016 10:11:57 +0000 (UTC) Received: (qmail 21556 invoked by uid 550); 29 Aug 2016 10:11:54 -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 21538 invoked from network); 29 Aug 2016 10:11:53 -0000 Date: Mon, 29 Aug 2016 18:11:37 +0800 From: Baoquan He To: Thomas Garnier Cc: Thomas Gleixner , Ingo Molnar , "H . Peter Anvin" , Eric Biederman , Andrew Morton , Xunlei Pang , HATAYAMA Daisuke , keescook@chromium.org, kernel-hardening@lists.openwall.com, surovegin@google.com, x86@kernel.org, kexec@lists.infradead.org, linux-kernel@vger.kernel.org Message-ID: <20160829101137.GA29344@x1.redhat.com> References: <1471531632-23003-1-git-send-email-thgarnie@google.com> MIME-Version: 1.0 Content-Disposition: inline In-Reply-To: <1471531632-23003-1-git-send-email-thgarnie@google.com> User-Agent: Mutt/1.5.21 (2010-09-15) X-Scanned-By: MIMEDefang 2.68 on 10.5.11.27 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Mon, 29 Aug 2016 10:11:42 +0000 (UTC) Subject: [kernel-hardening] Re: [PATCH v1] kdump, vmcoreinfo: report memory sections virtual addresses X-Virus-Scanned: ClamAV using ClamSMTP Hi Thomas, I used below code and it works. Since using VMCOREINFO_NUMBER can reuse the existing struct number_table to import the data. It makes change easier. But the place could be next to KERNEL_IMAGE_SIZE, or as your patch did, both is fine. --- kernel/kexec_core.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/kernel/kexec_core.c b/kernel/kexec_core.c index 5616755..81bde86 100644 --- a/kernel/kexec_core.c +++ b/kernel/kexec_core.c @@ -1469,6 +1469,9 @@ static int __init crash_save_vmcoreinfo_init(void) VMCOREINFO_NUMBER(PAGE_BUDDY_MAPCOUNT_VALUE); #ifdef CONFIG_X86 VMCOREINFO_NUMBER(KERNEL_IMAGE_SIZE); + VMCOREINFO_NUMBER(PAGE_OFFSET); + VMCOREINFO_NUMBER(VMALLOC_START); + VMCOREINFO_NUMBER(VMEMMAP_START); #endif #ifdef CONFIG_HUGETLB_PAGE VMCOREINFO_NUMBER(HUGETLB_PAGE_DTOR);