Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1345202

Re: [PATCH stable<3.18 1/1] proc: Fix ptrace-based permission checks for accessing task maps

Path csiph.com!aioe.org!bofh.it!news.nic.it!robomod
From Jiri Slaby <jslaby@suse.cz>
Newsgroups linux.kernel
Subject Re: [PATCH stable<3.18 1/1] proc: Fix ptrace-based permission checks for accessing task maps
Date Sun, 28 Feb 2016 11:10:02 +0100
Message-ID <r76sy-JY-7@gated-at.bofh.it> (permalink)
References <r76sy-JY-9@gated-at.bofh.it> <r76sy-JY-11@gated-at.bofh.it>
X-Google-Dkim-Signature v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:subject:to:references:cc:from:message-id:date :user-agent:mime-version:in-reply-to:content-transfer-encoding; bh=EWsJTnUhq5IkJKxPomhlohRdSA+oit75/Jeej6CHJXI=; b=AKXVDS9MVLcCRSNfaCTPQMeiR2MjlJXHQ2cJbE1KkMfCzhwqLEPo6Fy2ID97tcWDwO Mpmne+TuHNLO7PDBkn+9+xryTHp+4mvMKDm9oU/uvT21fX3QchHUbLctamCb6RW2q+jk yJXoqnz9gT3Dek0lPeuLm47uBoP9cPCRO/BVBlr8Zi8aUBoxDFlkJOvLP37IK5IR+5ER yzRO4Z4LopyXR5ml+sRzTcrRrR0ptusK0PHT5zex8Lpb3zJhhkucG84kP7kCOmP0xcuE eBXAUTMLf/R7Mt3Hr7ngw5ZlchOHmaPYA0YJAj67ngKdZ5QWbqqJ1TziF9sSe6oP/kL3 8x3g==
X-Gm-Message-State AD7BkJJmmOiICYNBdyTDciALLRgOmTVCWp6RuUV6d5T7VG46wb125HxfV0g+lFdz8O6Xeg==
X-Received by 10.194.249.42 with SMTP id yr10mr9673008wjc.12.1456653650039; Sun, 28 Feb 2016 02:00:50 -0800 (PST)
User-Agent Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0
MIME-Version 1.0
Content-Type text/plain; charset=windows-1252
Content-Transfer-Encoding 7bit
Sender robomod@news.nic.it
List-ID <linux-kernel.vger.kernel.org>
X-Mailing-List linux-kernel@vger.kernel.org
Approved robomod@news.nic.it
Lines 62
Organization linux.* mail to news gateway
X-Original-Cc Jann Horn <jann@thejh.net>, oleg@redhat.com, roland@hack.frob.com, Linux kernel mailing list <linux-kernel@vger.kernel.org>
X-Original-Date Sun, 28 Feb 2016 11:00:47 +0100
X-Original-Message-ID <56D2C54F.8010900@suse.cz>
X-Original-References <20160228023921.0f3909a6454c305068574adb@pobox.com> <20160228024239.c82b6c2db17c670611ee6b16@pobox.com>
X-Original-Sender linux-kernel-owner@vger.kernel.org
Xref csiph.com linux.kernel:1345202

Show key headers only | View raw


CCing ptrace guys.

I would appreciate if somebody could ACK this.

On 02/28/2016, 09:42 AM, Corey Wright wrote:
> Modify mm_access() calls in fs/proc/task_mmu.c and fs/proc/task_nommu.c to
> have the mode include PTRACE_MODE_FSCREDS so accessing /proc/pid/maps and
> /proc/pid/pagemap is not denied to all users.
> 
> In backporting upstream commit caaee623 to pre-3.18 kernel versions it was
> overlooked that mm_access() is used in fs/proc/task_*mmu.c as those calls
> were removed in 3.18 (by upstream commit 29a40ace) and did not exist at the
> time of the original commit.
> 
> Signed-off-by: Corey Wright <undefined@pobox.com>
> Cc: Jann Horn <jann@thejh.net>
> ---
>  fs/proc/task_mmu.c   |    4 ++--
>  fs/proc/task_nommu.c |    2 +-
>  2 files changed, 3 insertions(+), 3 deletions(-)
> 
> diff --git a/fs/proc/task_mmu.c b/fs/proc/task_mmu.c
> index 9f285fb..b86db12 100644
> --- a/fs/proc/task_mmu.c
> +++ b/fs/proc/task_mmu.c
> @@ -170,7 +170,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
>  	if (!priv->task)
>  		return ERR_PTR(-ESRCH);
>  
> -	mm = mm_access(priv->task, PTRACE_MODE_READ);
> +	mm = mm_access(priv->task, PTRACE_MODE_READ_FSCREDS);
>  	if (!mm || IS_ERR(mm))
>  		return mm;
>  	down_read(&mm->mmap_sem);
> @@ -1044,7 +1044,7 @@ static ssize_t pagemap_read(struct file *file, char __user *buf,
>  	if (!pm.buffer)
>  		goto out_task;
>  
> -	mm = mm_access(task, PTRACE_MODE_READ);
> +	mm = mm_access(task, PTRACE_MODE_READ_FSCREDS);
>  	ret = PTR_ERR(mm);
>  	if (!mm || IS_ERR(mm))
>  		goto out_free;
> diff --git a/fs/proc/task_nommu.c b/fs/proc/task_nommu.c
> index 56123a6..123c198 100644
> --- a/fs/proc/task_nommu.c
> +++ b/fs/proc/task_nommu.c
> @@ -223,7 +223,7 @@ static void *m_start(struct seq_file *m, loff_t *pos)
>  	if (!priv->task)
>  		return ERR_PTR(-ESRCH);
>  
> -	mm = mm_access(priv->task, PTRACE_MODE_READ);
> +	mm = mm_access(priv->task, PTRACE_MODE_READ_FSCREDS);
>  	if (!mm || IS_ERR(mm)) {
>  		put_task_struct(priv->task);
>  		priv->task = NULL;
> 


-- 
js
suse labs

Back to linux.kernel | Previous | Next | Find similar | Unroll thread


Thread

Re: [PATCH stable<3.18 1/1] proc: Fix ptrace-based permission checks  for accessing task maps Jiri Slaby <jslaby@suse.cz> - 2016-02-28 11:10 +0100

csiph-web