Message ID | 1536783844-4145-6-git-send-email-prakash.sangappa@oracle.com (mailing list archive) |
---|---|
State | New, archived |
Headers | show
Return-Path: <owner-linux-mm@kvack.org> Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id 3F50D112B for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 12 Sep 2018 20:25:19 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 2FDAB27C0B for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 12 Sep 2018 20:25:19 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 23B4A2A7D5; Wed, 12 Sep 2018 20:25: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=-3.0 required=2.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,MAILING_LIST_MULTI,RCVD_IN_DNSWL_NONE, UNPARSEABLE_RELAY autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id B995727C0B for <patchwork-linux-mm@patchwork.kernel.org>; Wed, 12 Sep 2018 20:25:18 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id A4AA08E0006; Wed, 12 Sep 2018 16:25:06 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 757148E000A; Wed, 12 Sep 2018 16:25:06 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 5D37A8E0009; Wed, 12 Sep 2018 16:25:06 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-yb1-f199.google.com (mail-yb1-f199.google.com [209.85.219.199]) by kanga.kvack.org (Postfix) with ESMTP id 1EDCC8E0008 for <linux-mm@kvack.org>; Wed, 12 Sep 2018 16:25:06 -0400 (EDT) Received: by mail-yb1-f199.google.com with SMTP id m9-v6so3135630ybm.20 for <linux-mm@kvack.org>; Wed, 12 Sep 2018 13:25:06 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:dkim-signature:from:to:cc:subject:date :message-id:in-reply-to:references; bh=Y0l/v4ChhDfpmg8ZWlOjGIPE6pA9rPqMOnxUCcNtxuw=; b=WqqHwpH2keZj45Lzi+X1j9fE+5qYOuqXSbYk4cBxnwQGx2ZVNNKUsmkWvDYvNKKV/O 1G/ymauJLpuXYxW1s1ArFU8dYfLGD2Kpibz2xYs6J9+WmcmJDwFTGikxeSHMZoqB9IAE bT/ghBvkss33JPIXqxwyJxqufusCNlSHsa3RCcBC+W+DSXdJ/hhutUck2UZDNtNOGIMt 2a5/cv/GMXlxkTRy2hPT8AtPOTSQ1mv82cyjMWtXMU7aNerxmFa3rrV5fM1FIrn6BbFe z5Og5xfHJgncwA2cVf+MUGCR/sMT5bOWdkcW9vS7fIsMfcoqtRbMV7tdLqYU3Ehxj35A McxA== X-Gm-Message-State: APzg51BYBpTWJoJxrBKcnT4aN4pOo2/ktnemRgDvZRvVgM4jMWozSCzM xACz7bio2AVtfx7CXUJvb6xiiUQWfm8g/vhllq/2bVmVp59BDy4YhEd4T+i0m6ORHmEKq/5HwIm bZFsqiQHfiLjyCdLdk3g+tSo/uHe/HdpqNBrtiWOj7VFKzawM2BL3NoxorNqKZpr0xg== X-Received: by 2002:a81:6d16:: with SMTP id i22-v6mr1806333ywc.112.1536783905867; Wed, 12 Sep 2018 13:25:05 -0700 (PDT) X-Google-Smtp-Source: ANB0VdYaX8Oc+f92p07OdXOMHNylqPEAf7iC1GLfI3vnXs1IwLywiNk7TXUb7sS4bvljRUJ+4Q/V X-Received: by 2002:a81:6d16:: with SMTP id i22-v6mr1806317ywc.112.1536783905006; Wed, 12 Sep 2018 13:25:05 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1536783904; cv=none; d=google.com; s=arc-20160816; b=qzuZrKMKpr48uwoi2Cx8MUBMubRjyr9eL8/kT26xwsO5AOuradd9bUm9UrGO69qbmy 3JkbpShKyGz6QrsT1bZhTNpUPT8yCjfIQT/CWiVEZ+g9EtjLFd+aBJyt+8PnFup/yDf2 FdoyKW+9J4FW1IVcT6FxUGQvMQhvI+v3qfe2Z8nGYyA24zoEcxj0mJzD2G0RCD8rgDHV k+QvymtFUCCy1RL74qvLfIYJYfozL3ddpS6ZGlaDyKMRJ4Ys00f9Fu7hIJqx+9PCcXUD yFzmmAYgUYZeAvPOumW6unEJdtt2HpkbPs/ubadVtVn+9VIyo2+8O0JJycqdpgngECs4 IxUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=Y0l/v4ChhDfpmg8ZWlOjGIPE6pA9rPqMOnxUCcNtxuw=; b=ZuDNn57Vv8NYc5hZc7/BTjWyBOuJ7kCi5JAGnBO8jsFm6VF7T41/bRZFVAQmaq6y39 F6d2zxM6RXd+ews2+XGadL9MZo8uibGMpVCvNtNeB67XHlsaL9EVThGDDniMkc6TDl1H rNn1YwmgqAmS8oe5oSF3+nHIzINMChYHJrG8MpJzDNPYxioKvBTJNCeZojks3FaU/prY ANpvcPjnNhgbm8+8gFeDvcinaB4M5kQH3wg1gZ0aJ+mx6BKrBNbwLsCZlkEN370ZL/Og MvWWm+oy8BMTrMXp3QYQ7humMnSt6NAI2etZjtTBLAI9VZpZreNVfqd5ueKzUHPlvZUq qp0A== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=dxS0rfKs; spf=pass (google.com: domain of prakash.sangappa@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=prakash.sangappa@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from aserp2120.oracle.com (aserp2120.oracle.com. [141.146.126.78]) by mx.google.com with ESMTPS id 191-v6si528277ybt.587.2018.09.12.13.25.04 for <linux-mm@kvack.org> (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 12 Sep 2018 13:25:04 -0700 (PDT) Received-SPF: pass (google.com: domain of prakash.sangappa@oracle.com designates 141.146.126.78 as permitted sender) client-ip=141.146.126.78; Authentication-Results: mx.google.com; dkim=pass header.i=@oracle.com header.s=corp-2018-07-02 header.b=dxS0rfKs; spf=pass (google.com: domain of prakash.sangappa@oracle.com designates 141.146.126.78 as permitted sender) smtp.mailfrom=prakash.sangappa@oracle.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=oracle.com Received: from pps.filterd (aserp2120.oracle.com [127.0.0.1]) by aserp2120.oracle.com (8.16.0.22/8.16.0.22) with SMTP id w8CKO66A084516; Wed, 12 Sep 2018 20:25:01 GMT DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=oracle.com; h=from : to : cc : subject : date : message-id : in-reply-to : references; s=corp-2018-07-02; bh=Y0l/v4ChhDfpmg8ZWlOjGIPE6pA9rPqMOnxUCcNtxuw=; b=dxS0rfKsKju22sqRkmq90rgMGeyxuu1cTGZIOpxJ2B3J6toBGsH8zY/kGZawq97J3b+G G486sbMzF0ut7DamaOi+wktauKqCHHCyZF854y/TTfJoGiGRdX6L8GylmJK3ib2ax5O1 w8btCMGGGM7G28SPXmt0cAuWWrbSKQKX+tXv6WfFYg4tvaWUM6fTGsEVptsneAQVwr6g P4bSlsaVPjfVzM6Mo/FTliefXwMHioYEqEm0yRtoFcgx1mrzLKl+jKqyvOw64TDhS+Su SoSkoplefjux75VAUQxW+vawv4su/MwTGwc7H7sldR+p+viW375BmEFiJ/6cN40rCylk lA== Received: from userv0022.oracle.com (userv0022.oracle.com [156.151.31.74]) by aserp2120.oracle.com with ESMTP id 2mc6cpvd7m-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:25:01 +0000 Received: from userv0121.oracle.com (userv0121.oracle.com [156.151.31.72]) by userv0022.oracle.com (8.14.4/8.14.4) with ESMTP id w8CKP0W1010267 (version=TLSv1/SSLv3 cipher=DHE-RSA-AES256-GCM-SHA384 bits=256 verify=OK); Wed, 12 Sep 2018 20:25:01 GMT Received: from abhmp0005.oracle.com (abhmp0005.oracle.com [141.146.116.11]) by userv0121.oracle.com (8.14.4/8.13.8) with ESMTP id w8CKP08W024321; Wed, 12 Sep 2018 20:25:00 GMT Received: from pp-ThinkCentre-M82.us.oracle.com (/10.132.93.61) by default (Oracle Beehive Gateway v4.0) with ESMTP ; Wed, 12 Sep 2018 13:25:00 -0700 From: Prakash Sangappa <prakash.sangappa@oracle.com> To: linux-kernel@vger.kernel.org, linux-mm@kvack.org Cc: dave.hansen@intel.com, mhocko@suse.com, nao.horiguchi@gmail.com, akpm@linux-foundation.org, kirill.shutemov@linux.intel.com, khandual@linux.vnet.ibm.com, steven.sistare@oracle.com, prakash.sangappa@oracle.com Subject: [PATCH V2 5/6] File /proc/<pid>/numa_vamaps access needs PTRACE_MODE_READ_REALCREDS check Date: Wed, 12 Sep 2018 13:24:03 -0700 Message-Id: <1536783844-4145-6-git-send-email-prakash.sangappa@oracle.com> X-Mailer: git-send-email 2.7.4 In-Reply-To: <1536783844-4145-1-git-send-email-prakash.sangappa@oracle.com> References: <1536783844-4145-1-git-send-email-prakash.sangappa@oracle.com> X-Proofpoint-Virus-Version: vendor=nai engine=5900 definitions=9014 signatures=668708 X-Proofpoint-Spam-Details: rule=notspam policy=default score=0 suspectscore=0 malwarescore=0 phishscore=0 bulkscore=0 spamscore=0 mlxscore=0 mlxlogscore=968 adultscore=0 classifier=spam adjust=0 reason=mlx scancount=1 engine=8.0.1-1807170000 definitions=main-1809120201 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: <linux-mm.kvack.org> X-Virus-Scanned: ClamAV using ClamSMTP |
Series |
VA to numa node information
|
expand
|
diff --git a/fs/proc/base.c b/fs/proc/base.c index 1af99ae..3c19a55 100644 --- a/fs/proc/base.c +++ b/fs/proc/base.c @@ -745,7 +745,9 @@ struct mm_struct *proc_mem_open(struct inode *inode, unsigned int mode) struct mm_struct *mm = ERR_PTR(-ESRCH); if (task) { - mm = mm_access(task, mode | PTRACE_MODE_FSCREDS); + if (!(mode & PTRACE_MODE_REALCREDS)) + mode |= PTRACE_MODE_FSCREDS; + mm = mm_access(task, mode); put_task_struct(task); if (!IS_ERR_OR_NULL(mm)) { diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c index 93dce46..30b29d2 100644 --- a/fs/proc/task_mmu.c +++ b/fs/proc/task_mmu.c @@ -2043,7 +2043,7 @@ static int numa_vamaps_open(struct inode *inode, struct file *file) if (!nvm) return -ENOMEM; - mm = proc_mem_open(inode, PTRACE_MODE_READ); + mm = proc_mem_open(inode, PTRACE_MODE_READ | PTRACE_MODE_REALCREDS); if (IS_ERR(mm)) { kfree(nvm); return PTR_ERR(mm);