linux-mips
[Top] [All Lists]

Re: [MIPS] Fix aliasing bug in copy_user_highpage, take 2.

To: ralf@linux-mips.org
Subject: Re: [MIPS] Fix aliasing bug in copy_user_highpage, take 2.
From: Atsushi Nemoto <anemo@mba.ocn.ne.jp>
Date: Wed, 17 Oct 2007 01:13:49 +0900 (JST)
Cc: linux-mips@linux-mips.org
In-reply-to: <20071016153806.GA23986@linux-mips.org>
Original-recipient: rfc822;linux-mips@linux-mips.org
References: <20071015182811.GA20157@linux-mips.org> <20071017.002916.07645039.anemo@mba.ocn.ne.jp> <20071016153806.GA23986@linux-mips.org>
Sender: linux-mips-bounce@linux-mips.org
On Tue, 16 Oct 2007 16:38:06 +0100, Ralf Baechle <ralf@linux-mips.org> wrote:
> > Hmm, setting SetPageDcacheDirty() will not make sure the modified data
> > flushed before reading via the kernel mapping.  The flush_dcache_page()
> > should be used for such case, shouldn't it?
> 
> You're right - and the intent is to _not_ flush the page.  But we're
> bringing it into the cache, so we better flush it before it will be mapped
> to userspace.  We want to delay the flush operation.

I see, but I'm afraid of unnecessary flushing might hide another
bug...

Setting SetPageDcacheDirty() for non-modified page looks a bit
overkill for me.  For example, in copy_user_highpage() we do not flush
the source page if the page was not mapped to userspace.

---
Atsushi Nemoto

<Prev in Thread] Current Thread [Next in Thread>