From: Andrew Morton <akpm@linux-foundation.org>
To: Michael Ellerman <michael@ellerman.id.au>
Cc: aarcange@redhat.com, riel@redhat.com, linuxppc-dev@ozlabs.org,
hughd@google.com, linux-kernel@vger.kernel.org,
linux-mm@kvack.org, walken@google.com
Subject: Re: [PATCH] mm: Check we have the right vma in __access_remote_vm()
Date: Mon, 11 Apr 2011 16:50:35 -0700 [thread overview]
Message-ID: <20110411165035.5a303647.akpm@linux-foundation.org> (raw)
In-Reply-To: <10e5cbf67c850b6ae511979bdbad1761236ad9b0.1302247435.git.michael@ellerman.id.au>
On Fri, 8 Apr 2011 17:24:01 +1000 (EST)
Michael Ellerman <michael@ellerman.id.au> wrote:
> In __access_remote_vm() we need to check that we have found the right
> vma, not the following vma, before we try to access it. Otherwise we
> might call the vma's access routine with an address which does not
> fall inside the vma.
>
hm, mysteries. Does this patch fix any known problem in any known
kernel, or was the problem discovered by inspection, or what?
>
> diff --git a/mm/memory.c b/mm/memory.c
> index 9da8cab..ce999ca 100644
> --- a/mm/memory.c
> +++ b/mm/memory.c
> @@ -3678,7 +3678,7 @@ static int __access_remote_vm(struct task_struct *tsk, struct mm_struct *mm,
> */
> #ifdef CONFIG_HAVE_IOREMAP_PROT
> vma = find_vma(mm, addr);
> - if (!vma)
> + if (!vma || vma->vm_start > addr)
> break;
> if (vma->vm_ops && vma->vm_ops->access)
> ret = vma->vm_ops->access(vma, addr, buf,
next prev parent reply other threads:[~2011-04-11 23:50 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2011-04-08 7:24 [PATCH] mm: Check we have the right vma in __access_remote_vm() Michael Ellerman
2011-04-08 8:42 ` KOSAKI Motohiro
2011-04-11 23:50 ` Andrew Morton [this message]
2011-04-12 0:34 ` Michael Ellerman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20110411165035.5a303647.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=aarcange@redhat.com \
--cc=hughd@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-mm@kvack.org \
--cc=linuxppc-dev@ozlabs.org \
--cc=michael@ellerman.id.au \
--cc=riel@redhat.com \
--cc=walken@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).