lkml.org 
[lkml]   [2007]   [Jul]   [10]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: maps2-add-proc-pid-pagemap-interface.patch
From
Date
On Mon, 2007-07-09 at 17:31 -0500, Matt Mackall wrote:
> > And how about "cpu_to_le16(1) == 1" instead of "ntohl(1) != 1"?
>
> Why?

Using a networking macro to detect endianness is old school: we have the
nice explicit macros these days...

> > > + while (pm.count > 0 && vma) {
> > > + if (!ptrace_may_attach(task)) {
> > > + ret = -EIO;
> > > + goto out_mm;
> > > + }
> >
> > You already checked ptrace_may_attach() earlier in this function; do you
> > need to do that again?
>
> I think so. Consider exec(). This whole area is full of interesting
> traps and it pays to be paranoid.

I don't think normal ptraces get cut on exec, so I'm not sure why this
should be different. You could argue it would be more correct to check
at the open, in fact.

Cheers,
Rusty.

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/

\
 
 \ /
  Last update: 2007-07-10 06:31    [W:0.058 / U:0.176 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site