From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1757221AbcB1KAx (ORCPT ); Sun, 28 Feb 2016 05:00:53 -0500 Received: from mail-wm0-f66.google.com ([74.125.82.66]:36373 "EHLO mail-wm0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751477AbcB1KAv (ORCPT ); Sun, 28 Feb 2016 05:00:51 -0500 Subject: Re: [PATCH stable<3.18 1/1] proc: Fix ptrace-based permission checks for accessing task maps To: Corey Wright , stable@vger.kernel.org References: <20160228023921.0f3909a6454c305068574adb@pobox.com> <20160228024239.c82b6c2db17c670611ee6b16@pobox.com> Cc: Jann Horn , oleg@redhat.com, roland@hack.frob.com, Linux kernel mailing list From: Jiri Slaby Message-ID: <56D2C54F.8010900@suse.cz> Date: Sun, 28 Feb 2016 11:00:47 +0100 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:38.0) Gecko/20100101 Thunderbird/38.6.0 MIME-Version: 1.0 In-Reply-To: <20160228024239.c82b6c2db17c670611ee6b16@pobox.com> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org 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 > Cc: Jann Horn > --- > 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