Received: by 10.223.176.5 with SMTP id f5csp3925353wra; Mon, 29 Jan 2018 22:44:06 -0800 (PST) X-Google-Smtp-Source: AH8x22439mMgdl5CMO2xKDsO3jVEgnal2sFXocMQgLSKYod1Aeuvr/rU1wTBTjU5oJwVfTnRfy6B X-Received: by 10.98.157.26 with SMTP id i26mr29161450pfd.12.1517294646429; Mon, 29 Jan 2018 22:44:06 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1517294646; cv=none; d=google.com; s=arc-20160816; b=gqavARKztgT/GcwiN9hImWTdPJP82qnSAnJ5d/Nw/WQlSKyUXCVjcB0QmqdMtBBXVn 8qh3NhXE9smmFNIzQ66suGPgkZx08xPAiU/VRdrQwCOSQ9cTx037ljQaZ5hF0jnapsVc 5rhmHq/mFjKq3iuU+cP4VW8Nsp4zRVMnj6KLcVsLiY0KyZG90ofp6AmEz62+lchPT1nD vEX3dfi6O49NrXPbt0GfCns/b9KGJJPu4j0MBPD5oRb9qZ1RtIF9dJSMKpzf57+bXF/Y niEFGIZ23WrZAEdzFi5Qr/AV7qo7Vk38ZRYWUYM9kx4m2QeQE5XYwZbj3QAUxVkbsUEX Koog== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:references:in-reply-to:message-id:date :subject:cc:to:from:arc-authentication-results; bh=um9gWJ6RuRutxfrM7KXCqIhIrAGylvEGdGKCQBxWLkg=; b=DcTB9t+CBBRhD6LOHxkRWL86H82o9TisaEybEoc9QzObbUdBGTwnvF+QkLlcPG6XAG 8R/66M8nfzMEuf+v/VMq/kdDF9ULI+2Q/MAt3L/kXsxEW7lWiOTjfIIFNa+LqcNBdSrn gZJqxahwJBIcN8fcrJgk2cca6x7z+NkVDS//baY7uZ6mm+b+4KaqBdqMevWlog2feXY7 z5DmHOXpaMNsJsnLFEeV9Vka1qoyxTAVYD9vJxgMoWrgzETpHIwEv99Qrgz8vKkm1De8 vGdtWMhvFm2/ziq3QreHvG3NkwJEb7Ffu7mpIdKwPWDBQFXSRwypeGmguZyoF1xdgD/0 2VuQ== 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id t190si1081004pgb.190.2018.01.29.22.43.50; Mon, 29 Jan 2018 22:44:06 -0800 (PST) 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; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=alibaba.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1751663AbeA3Gn0 (ORCPT + 99 others); Tue, 30 Jan 2018 01:43:26 -0500 Received: from out30-131.freemail.mail.aliyun.com ([115.124.30.131]:37707 "EHLO out30-131.freemail.mail.aliyun.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751322AbeA3GnX (ORCPT ); Tue, 30 Jan 2018 01:43:23 -0500 X-Alimail-AntiSpam: AC=PASS;BC=-1|-1;BR=01201311R161e4;CH=green;FP=0|-1|-1|-1|0|-1|-1|-1;HT=e01e01429;MF=zhang.jia@linux.alibaba.com;NM=1;PH=DS;RN=6;SR=0;TI=SMTPD_---0SxLmNSb_1517294582; Received: from localhost(mailfrom:zhang.jia@linux.alibaba.com fp:106.11.233.15) by smtp.aliyun-inc.com(127.0.0.1); Tue, 30 Jan 2018 14:43:02 +0800 From: Jia Zhang To: tglx@linutronix.de, mingo@redhat.com, hpa@zytor.com Cc: x86@kernel.org, linux-kernel@vger.kernel.org, Jia Zhang Subject: [PATCH 2/2] x86/mm/64: Add vsyscall page to /proc/kcore conditionally Date: Tue, 30 Jan 2018 14:42:59 +0800 Message-Id: <1517294579-117473-2-git-send-email-zhang.jia@linux.alibaba.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1517294579-117473-1-git-send-email-zhang.jia@linux.alibaba.com> References: <1517294579-117473-1-git-send-email-zhang.jia@linux.alibaba.com> Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org The vsyscall page should be visible only if vsyscall=emulate/native when dumping /proc/kcore. Signed-off-by: Jia Zhang --- arch/x86/mm/init_64.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index dab78f6..3d4cf33 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1186,8 +1186,9 @@ void __init mem_init(void) register_page_bootmem_info(); /* Register memory areas for /proc/kcore */ - kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, - PAGE_SIZE, KCORE_USER); + if (get_gate_vma(&init_mm)) + kclist_add(&kcore_vsyscall, (void *)VSYSCALL_ADDR, + PAGE_SIZE, KCORE_USER); mem_init_print_info(NULL); } -- 1.8.3.1