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 for Android: free password hash cracker in your pocket
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date:	Tue, 17 Feb 2009 13:05:34 +0100
From:	Peter Zijlstra <peterz@...radead.org>
To:	Nick Piggin <npiggin@...e.de>
Cc:	Edward Shishkin <edward.shishkin@...il.com>,
	Andrew Morton <akpm@...ux-foundation.org>,
	Ryan Hope <rmh3093@...il.com>,
	Randy Dunlap <randy.dunlap@...cle.com>,
	linux-kernel@...r.kernel.org,
	ReiserFS Mailing List <reiserfs-devel@...r.kernel.org>
Subject: Re: set_page_dirty races (was: Re: [patch 2/4] vfs: add
 set_page_dirty_notag)

On Tue, 2009-02-17 at 12:55 +0100, Nick Piggin wrote:
> On Tue, Feb 17, 2009 at 12:39:32PM +0100, Peter Zijlstra wrote:
> > On Tue, 2009-02-17 at 12:25 +0100, Nick Piggin wrote:
> > 
> > > Introduce put_user_pages function.
> > > 
> > > In order to have more flexibility to deal with issues surrounding
> > > get_user_pages difficulties[*], introduce put_user_pages function
> > > intended to release pages acquired by get_user_pages. For now, just
> > > do the regular put_page thing. If all callers are converted, it could
> > > be used to help with such races. In the meantime, it will actually
> > > serve as a small extra piece of documentation for the code.
> > > 
> > > [*] eg. get_user_pages caller can bypass page_mkwrite calls into the
> > >     filesystem to notify of page dirty activity if the page gets cleaned
> > >     before the caller calls its final set_page_dirty).
> > 
> > Hmm, if we want to distinguish between .write=1 and .write=0, we would
> > have to pass .write to pup too, right?
> 
> Doh, yeah. I hand edited the patch to put that parameter in, but quilt
> refresh must have outsmarted me!
> 
> If nobody thinks it is insane, I'll resend to Andrew in a new thread.

Right, gup_fast() seems to also respect .write properly, so it would
also be used to balance that.

I guess gup_fast() would need to use trylock_page(), and fall back to
the slow path when we start taking PG_locked on .write.

I suppose we should start converting a few gup users over to pup before
handing the thing to Andrew, to have at least a few examples in-kernel.

--
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