Re: [patch 0/6] fault vs truncate/invalidate race fix

!MAILaRCHIVE_VOTE_RePLACE
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]
To: Andrew Morton <akpm@...>
Cc: Dave Airlie <airlied@...>, <linux-mm@...>, <linux-kernel@...>, <benh@...>
Date: Tuesday, February 27, 2007 - 4:50 am

On Mon, Feb 26, 2007 at 09:32:04PM -0800, Andrew Morton wrote:

s/harder/easier of course...

I think there is good reason to assume the buffered write page lock
deadlocks would not occur in "normal" programs (or very very few),
because it would require writing from the same page you are writing to,
or 2 processes writing from the page the other is writing to. If any
innocent users do hit this, at least it is not data corrupting, and is
relatively easy to trace back to the kernel.

In the case of local DoS exploits, the deadlocks already present in the
buffered write path are already trivial to exploit...  locking the page
in the fault path doesn't make the deadlock exploit any more possible.

So the downside to merging is that we _may_ get some additional deadlocks.

What is being fixed is silent data corruption that has been reported by
several different users of the SLES kernel (because we have assertions
there to catch it), and can be triggered by DIO or NFS, or anything using
vmtruncate_range or invalidate_inode_pages2 on regular files. Or even a
regular truncate with nonlinear pages. These are known problems on
production workloads.

That's my argument for merging these. I think it's reasonable, but I'm
open to debate.

I did get some page fault performance numbers at one stage. Nothing
really exciting seemed to happen IIRC, but I can do another set of tests
if you want?


To be fair, I have 2 ways to fix it. Unfortunately one is slow and the
other requires cooperation from filesystem developers. perform_write() is
still on track, but it is going to take a reasonable amount of time and
effort to convert filesystems. I just can't see any gain in holding these
patches back until that all happens.

Thanks,
Nick
-
Previous message: [thread] [date] [author]
Next message: [thread] [date] [author]

Messages in current thread:
[patch 0/6] fault vs truncate/invalidate race fix, Nick Piggin, (Wed Feb 21, 12:49 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Dave Airlie, (Tue Feb 27, 12:36 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Andrew Morton, (Tue Feb 27, 1:32 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Nick Piggin, (Tue Feb 27, 4:50 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Dave Airlie, (Tue Feb 27, 2:26 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Benjamin Herrenschmidt, (Tue Feb 27, 2:54 am)
Re: [patch 0/6] fault vs truncate/invalidate race fix, Dave Airlie, (Sun Mar 18, 7:13 pm)
Re: [patch 4/6] mm: merge populate and nopage into fault (fi..., Benjamin Herrenschmidt, (Wed Mar 7, 6:05 am)
Re: [patch 4/6] mm: merge populate and nopage into fault (fi..., Benjamin Herrenschmidt, (Wed Mar 7, 6:46 am)
[rfc][patch 7/6] mm: merge page_mkwrite, Nick Piggin, (Wed Mar 7, 6:30 am)
[RFC][PATCH] mm: fix page_mkclean() vs non-linear vmas, Peter Zijlstra, (Wed Mar 7, 12:58 pm)
[patch 6/6] mm: remove legacy cruft, Nick Piggin, (Wed Feb 21, 12:50 am)
[patch 5/6] mm: merge nopfn into fault, Nick Piggin, (Wed Feb 21, 12:50 am)
Re: [patch 5/6] mm: merge nopfn into fault, Nick Piggin, (Wed Feb 21, 1:13 am)
[patch 2/6] mm: simplify filemap_nopage, Nick Piggin, (Wed Feb 21, 12:49 am)