From: Andrew Morton <akpm@linux-foundation.org>
To: Matt Mackall <mpm@selenic.com>
Cc: ttuttle@google.com, linux-kernel@vger.kernel.org, stable@kernel.org
Subject: Re: [PATCH 1/4] pagemap: Require reads of /proc/pid/pagemap to be multiples of 8 (v2 of series)
Date: Thu, 5 Jun 2008 15:05:02 -0700 [thread overview]
Message-ID: <20080605150502.77e7ade8.akpm@linux-foundation.org> (raw)
In-Reply-To: <1212699119.3953.206.camel@calx>
On Thu, 05 Jun 2008 15:51:59 -0500
Matt Mackall <mpm@selenic.com> wrote:
>
> On Thu, 2008-06-05 at 12:37 -0700, Andrew Morton wrote:
> > On Thu, 5 Jun 2008 14:38:10 -0400
> > "Thomas Tuttle" <ttuttle@google.com> wrote:
> >
> > > This matches the behavior of /proc/kpage{count,flags}, and simplifies
> > > the logic a bit.
> > >
> > > I also changed out and end in struct pagemapread to be u64* instead of
> > > char*, which makes put_user work the way it was intended. (Before, it
> > > was only copying the bottom byte of a pagemap entry, because the target
> > > of the copy was a char*.)
> >
> > This one is for 2.6.25.x?
>
> This one is for 2.6.26. Something more like this for 2.6.25.x:
>
> Because put_user bases its copy size on the size of the target pointer,
> not the source, it was copying only 1 byte rather than the intended 8.
>
> Spotted-by: Thomas Tuttle <ttuttle@google.com>
> Signed-off-by: Matt Mackall <mpm@selenic.com>
>
> diff -r 5030869d9ded fs/proc/task_mmu.c
> --- a/fs/proc/task_mmu.c Thu Jun 05 04:01:40 2008 +0000
> +++ b/fs/proc/task_mmu.c Thu Jun 05 15:45:00 2008 -0500
> @@ -531,7 +531,7 @@
> return PM_END_OF_BUFFER;
> }
>
> - if (put_user(pfn, pm->out))
> + if (put_user(pfn, (u64 *)pm->out))
> return -EFAULT;
> pm->out += PM_ENTRY_BYTES;
> return 0;
>
>
OK. I can't merge that I guess, so could someome please prepare a
formal patch for the stable guys? Preferably one which remembers
to add __user to that cast :)
prev parent reply other threads:[~2008-06-05 22:06 UTC|newest]
Thread overview: 4+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-06-05 18:38 [PATCH 1/4] pagemap: Require reads of /proc/pid/pagemap to be multiples of 8 (v2 of series) Thomas Tuttle
2008-06-05 19:37 ` Andrew Morton
2008-06-05 20:51 ` Matt Mackall
2008-06-05 22:05 ` Andrew Morton [this message]
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=20080605150502.77e7ade8.akpm@linux-foundation.org \
--to=akpm@linux-foundation.org \
--cc=linux-kernel@vger.kernel.org \
--cc=mpm@selenic.com \
--cc=stable@kernel.org \
--cc=ttuttle@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