lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20100525184700.GJ20853@laptop>
Date:	Wed, 26 May 2010 04:47:00 +1000
From:	Nick Piggin <npiggin@...e.de>
To:	Albert Herranz <albert_herranz@...oo.es>
Cc:	aya Kumar <jayakumar.lkml@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Linus Torvalds <torvalds@...ux-foundation.org>,
	linux-mm@...ck.org, linux-fsdevel@...r.kernel.org,
	linux-kernel@...r.kernel.org, linux-fbdev@...r.kernel.org
Subject: Re: page_mkwrite vs pte dirty race in fb_defio

On Tue, May 25, 2010 at 08:26:31PM +0200, Albert Herranz wrote:
> Hi,
> 
> On 05/25/2010 06:01 PM, Nick Piggin wrote:
> > Hi,
> > 
> > I couldn't find where this patch (49bbd815fd8) was discussed, so I'll
> > make my own thread. Adding a few lists to cc because it might be of
> > interest to driver and filesystem writers.
> > 
> 
> The original thread can be found here:
> http://marc.info/?l=linux-fbdev&m=127369791432181

Thanks.

 
> > The old ->page_mkwrite calling convention was causing problems exactly
> > because of this race, and we solved it by allowing page_mkwrite to
> > return with the page locked, and the lock will be held until the
> > pte is marked dirty. See commit b827e496c893de0c0f142abfaeb8730a2fd6b37f.
> > 
> 
> Ah, didn't know about that. Thanks for the pointer.
> 
> > I hope that should provide a more elegant solution to your problem. I
> > would really like you to take a look at that, because we already have
> > filesystem code (NFS) relying on it, and more code we have relying on
> > this synchronization, the more chance we would find a subtle problem
> > with it (also it should be just nicer).
> > 
> 
> So if I undestand it correctly, using the "new" calling convention I should just lock the page on fb_deferred_io_mkwrite() and return VM_FAULT_LOCKED to fix the described race for fb_defio.

As far as I can see from quick reading of the fb_defio code, yes
that should solve it (provided you lock the page inside the mutex,
of course).

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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ