Re: ptrace can't be transparent on readonly MAP_SHARED

From: Andrea Arcangeli
Date: Thu Sep 15 2005 - 11:24:05 EST


On Thu, Sep 15, 2005 at 09:13:02AM -0700, Linus Torvalds wrote:
>
>
> On Thu, 15 Sep 2005, Andrea Arcangeli wrote:
>
> > On Thu, Sep 15, 2005 at 08:12:59AM -0700, Linus Torvalds wrote:
> > > have a PROT_READONLY/PROT_NONE area that is visible from the debugger, but
> > > continues to cause SIGSEGV's if the user process itself tries to access
> > > it. To me, that's good.
> >
> > Continue to cause sigsegv yes, but on the wrong page, when it will read
> > the page it can contain different data compared to what is on
> > disk/pagecache.
>
> So? You're not making any sense.

I'll try again: what is the point of still getting page faults on writes
when the first read will contain the wrong data?

And what is the point of writing to a prot_none with ptrace? That really
makes no sense.

I'm not saying the cow should go away, I'm saying that marking the pte
readonly after writing to it makes no sense.

I've said maybe_mkwrite makes no sense, I didn't say the cow makes no
sense.

> I repeat: we CANNOT AVOID the fact that we will do COW.
>
> That COW is required. No way we can avoid it. It has _nothing_ to do with
> maybe_mkwrite().
>
> So I don't know why you continually refuse to just admit that fact. Why do
> you mix up the COW semantics with the maybe_mkwrite() semantics.
>
> If you can't argue against maybe_mkwrite() without involving the COW
> argument, then stop arguing. They are two totally different thigns.

I wasn't arguing about that, infact Hugh noticed that I suggested that
avoiding the cow is not an option (he's the one that disagreed with you
on this if something).
-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/