Carsten Otte ab92661d5d do_wp_page: fix regression with execute in place
Fix do_wp_page for VM_MIXEDMAP mappings.

In the case where pfn_valid returns 0 for a pfn at the beginning of
do_wp_page and the mapping is not shared writable, the code branches to
label `gotten:' with old_page == NULL.

In case the vma is locked (vma->vm_flags & VM_LOCKED), lock_page,
clear_page_mlock, and unlock_page try to access the old_page.

This patch checks whether old_page is valid before it is dereferenced.

The regression was introduced by "mlock: mlocked pages are unevictable"
(commit b291f000393f5a0b679012b39d79fbc85c018233).

Signed-off-by: Carsten Otte <cotte@de.ibm.com>
Cc: Nick Piggin <npiggin@suse.de>
Cc: Heiko Carstens <heiko.carstens@de.ibm.com>
Cc: <stable@kernel.org>		[2.6.28.x]
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2009-02-05 12:56:48 -08:00
..
2008-12-29 11:27:46 +02:00
2009-01-06 15:59:14 -08:00
2009-01-06 15:59:08 -08:00
2007-10-20 01:27:18 +02:00
2008-07-28 16:30:21 -07:00
2009-01-08 08:31:07 -08:00
2009-01-08 08:31:05 -08:00
2008-06-12 18:05:41 -07:00
2009-01-01 10:12:29 +10:30
2007-10-20 01:27:18 +02:00
2009-01-01 10:12:29 +10:30
2008-11-30 10:03:35 -08:00
2009-01-08 08:31:05 -08:00
2009-01-08 08:31:08 -08:00
2009-01-01 10:12:29 +10:30