Nick Piggin 538f8ea6c8 mm: xip fix fault vs sparse page invalidate race
XIP has a race between sparse pages being inserted into page tables, and
sparse pages being zapped when its time to put a non-sparse page in.

What can happen is that a process can be left with a dangling sparse page
in a MAP_SHARED mapping, while the rest of the world sees the non-sparse
version.  Ie.  data corruption.

Guard these operations with a seqlock, making fault-in-sparse-pages the
slowpath, and try-to-unmap-sparse-pages the fastpath.

Signed-off-by: Nick Piggin <npiggin@suse.de>
Cc: Jared Hulbert <jaredeh@gmail.com>
Acked-by: Carsten Otte <cotte@freenet.de>
Cc: Hugh Dickins <hugh@veritas.com>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2008-08-20 15:40:32 -07:00
..
2008-08-04 21:31:34 -07:00
2008-07-28 16:30:21 -07:00
2008-07-19 22:39:46 -07:00
2008-07-24 10:47:17 -07:00
2008-07-28 16:30:21 -07:00
2008-08-04 21:31:34 -07:00
2007-10-20 01:27:18 +02:00
2008-08-04 21:31:34 -07:00
2008-04-28 08:58:18 -07:00
2008-08-04 16:58:45 -07:00
2008-07-28 16:30:21 -07:00
2008-07-28 16:30:21 -07:00
2008-07-28 16:30:21 -07:00
2008-08-04 16:01:47 +09:00
2008-02-05 09:44:19 -08:00
2008-07-26 12:00:06 -07:00
2008-06-12 18:05:41 -07:00
2007-10-20 01:27:18 +02:00
2008-07-26 12:00:06 -07:00
2008-08-20 15:40:32 -07:00
2008-08-04 21:31:34 -07:00
2008-07-29 23:44:26 +03:00
2008-07-29 23:44:26 +03:00
2008-08-05 09:28:47 +03:00
2008-07-04 10:40:04 -07:00
2008-08-20 15:40:30 -07:00
2008-08-04 21:31:34 -07:00
2008-08-04 21:31:34 -07:00
2008-08-04 21:31:34 -07:00
2008-07-26 12:00:07 -07:00
2008-08-04 21:31:34 -07:00
2008-07-24 10:47:14 -07:00