From patchwork Tue Sep 13 07:08: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: 9328431 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 A0E0A60839 for ; Tue, 13 Sep 2016 07:09:02 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 957E928A0E for ; Tue, 13 Sep 2016 07:09:02 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 89FAD2919B; Tue, 13 Sep 2016 07:09:02 +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 9D5EA28A0E for ; Tue, 13 Sep 2016 07:09:00 +0000 (UTC) Received: (qmail 21711 invoked by uid 550); 13 Sep 2016 07:08:58 -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 21693 invoked from network); 13 Sep 2016 07:08:57 -0000 From: Baoquan He To: tonli@redhat.com, Thomas Garnier Cc: Baoquan He , 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 Date: Tue, 13 Sep 2016 15:08:37 +0800 Message-Id: <1473750517-5749-1-git-send-email-bhe@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.68 on 10.5.11.23 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.31]); Tue, 13 Sep 2016 07:08:46 +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);