Received: by 10.223.185.116 with SMTP id b49csp3363953wrg; Tue, 13 Feb 2018 01:11:32 -0800 (PST) X-Google-Smtp-Source: AH8x224hmSx+krPb+egpXjZ5Yu7wNeqiop8YLx9MaC4bd6NQZ6fkP9cGpjStZiaF0VrAuPltutsd X-Received: by 10.99.117.28 with SMTP id q28mr455269pgc.187.1518513092560; Tue, 13 Feb 2018 01:11:32 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1518513092; cv=none; d=google.com; s=arc-20160816; b=Ic5/IPF98SBhHMYBVycMlIeXDCQiCp3jUKJFbEcjlOYpxI4Z+snXVXnu3cU0+yGGgM v3woFoq3qI7v086MHTALd1p8i7OxiARD43W9N4Md8mdGfvUGbg7hvCc7VCUPgnJbRj4U 4M1BI9a+T0xl0kv6U53c9Zxsbl6D+O20qNeyvtzgZgpT0U3hTYZg7NWXI8+GXw+S+AKm CSaTs3xkIqmj5p95YkogNYDs+2KzEDEgowW6STVPjoqavJnleADfeliMkjC+0hl/8APm IiJNQ9KbtZ7sI4w4XsmSL+93sR5PsVSeWpjYq9LR0BC1g3NSHZzbq3m82k6jZODIUvuT cPqQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-disposition :content-transfer-encoding:mime-version:robot-unsubscribe:robot-id :git-commit-id:subject:to:references:in-reply-to:reply-to:cc :message-id:from:date:arc-authentication-results; bh=+qryqzT+5H5Tf+Vhj9UoTOohTtwY8ui1OhPNN0gVX/g=; b=nTeURo5EPGCaz5w5PDVEJmrhJfVtslBqgYTGlcsywz7kEsYQqOAsjkyfiOMNxHTzgj sgBtI9MC+HP5Ti+RGHdHwBaeAztmXWO+SOc0HSZhQRBBmIbwP+rihoVAnjCq9mStYQza 2xOLRC7B9wpVM7SaqBr+8ggqU4FjdF9/eFOjYVajvnbABWJA7J5VUL/yu4bGXNtJQD2Q ue6QuqlTv/HOvm7OwxWd6waaRqOcPaXONdQw89+edna0YJ+2FbnlOMKWBS6BYQ/9Pkqn UCRaWB4CmpULJIz2qm6XqwOItFR1+HK8y7Y7SVTnoyGz2iqwFsAEsAQ0K0xCqCejb/cG or/A== 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e1-v6si938603ple.154.2018.02.13.01.11.18; Tue, 13 Feb 2018 01:11:32 -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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S933955AbeBMJJv (ORCPT + 99 others); Tue, 13 Feb 2018 04:09:51 -0500 Received: from terminus.zytor.com ([198.137.202.136]:58365 "EHLO terminus.zytor.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934019AbeBMJIa (ORCPT ); Tue, 13 Feb 2018 04:08:30 -0500 Received: from terminus.zytor.com (localhost [127.0.0.1]) by terminus.zytor.com (8.15.2/8.15.2) with ESMTP id w1D98AL8027631; Tue, 13 Feb 2018 01:08:10 -0800 Received: (from tipbot@localhost) by terminus.zytor.com (8.15.2/8.15.2/Submit) id w1D989g0027627; Tue, 13 Feb 2018 01:08:09 -0800 Date: Tue, 13 Feb 2018 01:08:09 -0800 X-Authentication-Warning: terminus.zytor.com: tipbot set sender to tipbot@zytor.com using -f From: tip-bot for Jia Zhang Message-ID: Cc: jolsa@kernel.org, mingo@kernel.org, hpa@zytor.com, zhang.jia@linux.alibaba.com, peterz@infradead.org, tglx@linutronix.de, viro@zeniv.linux.org.uk, linux-kernel@vger.kernel.org, torvalds@linux-foundation.org Reply-To: tglx@linutronix.de, viro@zeniv.linux.org.uk, torvalds@linux-foundation.org, linux-kernel@vger.kernel.org, jolsa@kernel.org, mingo@kernel.org, hpa@zytor.com, zhang.jia@linux.alibaba.com, peterz@infradead.org In-Reply-To: <1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com> References: <1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com> To: linux-tip-commits@vger.kernel.org Subject: [tip:x86/urgent] x86/mm/kcore: Add vsyscall page to /proc/kcore conditionally Git-Commit-ID: cd026ca2861e7f384d677626a483da797c76b9da X-Mailer: tip-git-log-daemon Robot-ID: Robot-Unsubscribe: Contact to get blacklisted from these emails MIME-Version: 1.0 Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset=UTF-8 Content-Disposition: inline X-Spam-Status: No, score=-2.9 required=5.0 tests=ALL_TRUSTED,BAYES_00 autolearn=ham autolearn_force=no version=3.4.1 X-Spam-Checker-Version: SpamAssassin 3.4.1 (2015-04-28) on terminus.zytor.com Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Commit-ID: cd026ca2861e7f384d677626a483da797c76b9da Gitweb: https://git.kernel.org/tip/cd026ca2861e7f384d677626a483da797c76b9da Author: Jia Zhang AuthorDate: Mon, 12 Feb 2018 22:44:54 +0800 Committer: Ingo Molnar CommitDate: Tue, 13 Feb 2018 09:15:59 +0100 x86/mm/kcore: Add vsyscall page to /proc/kcore conditionally The vsyscall page should be visible only if vsyscall=emulate/native when dumping /proc/kcore. Signed-off-by: Jia Zhang Reviewed-by: Jiri Olsa Cc: Al Viro Cc: Linus Torvalds Cc: Peter Zijlstra Cc: Thomas Gleixner Cc: jolsa@redhat.com Link: http://lkml.kernel.org/r/1518446694-21124-3-git-send-email-zhang.jia@linux.alibaba.com Signed-off-by: Ingo Molnar --- arch/x86/mm/init_64.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/x86/mm/init_64.c b/arch/x86/mm/init_64.c index 6aa33d1..8ba9c31 100644 --- a/arch/x86/mm/init_64.c +++ b/arch/x86/mm/init_64.c @@ -1193,7 +1193,8 @@ 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); }