+ do_wp_page-fix-regression-with-execute-in-place.patch added to -mm tree

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



The patch titled
     do_wp_page: fix regression with execute in place
has been added to the -mm tree.  Its filename is
     do_wp_page-fix-regression-with-execute-in-place.patch

Before you just go and hit "reply", please:
   a) Consider who else should be cc'ed
   b) Prefer to cc a suitable mailing list as well
   c) Ideally: find the original patch on the mailing list and do a
      reply-to-all to that, adding suitable additional cc's

*** Remember to use Documentation/SubmitChecklist when testing your code ***

See http://userweb.kernel.org/~akpm/stuff/added-to-mm.txt to find
out what to do about this

The current -mm tree may be found at http://userweb.kernel.org/~akpm/mmotm/

------------------------------------------------------
Subject: do_wp_page: fix regression with execute in place
From: Carsten Otte <cotte@xxxxxxxxxx>

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

commit b291f000393f5a0b679012b39d79fbc85c018233
Author:     Nick Piggin <npiggin@xxxxxxx>
AuthorDate: Sat Oct 18 20:26:44 2008 -0700
Commit:     Linus Torvalds <torvalds@xxxxxxxxxxxxxxxxxxxx>
CommitDate: Mon Oct 20 08:52:30 2008 -0700

    mlock: mlocked pages are unevictable


Signed-off-by: Carsten Otte <cotte@xxxxxxxxxx>
Cc: Nick Piggin <npiggin@xxxxxxx>
Cc: Heiko Carstens <heiko.carstens@xxxxxxxxxx>
Cc: <stable@xxxxxxxxxx>		[2.6.28.x]
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/memory.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff -puN mm/memory.c~do_wp_page-fix-regression-with-execute-in-place mm/memory.c
--- a/mm/memory.c~do_wp_page-fix-regression-with-execute-in-place
+++ a/mm/memory.c
@@ -1999,7 +1999,7 @@ gotten:
 	 * Don't let another task, with possibly unlocked vma,
 	 * keep the mlocked page.
 	 */
-	if (vma->vm_flags & VM_LOCKED) {
+	if ((vma->vm_flags & VM_LOCKED) && old_page) {
 		lock_page(old_page);	/* for LRU manipulation */
 		clear_page_mlock(old_page);
 		unlock_page(old_page);
_

Patches currently in -mm which might be from cotte@xxxxxxxxxx are

linux-next.patch
do_wp_page-fix-regression-with-execute-in-place.patch

--
To unsubscribe from this list: send the line "unsubscribe mm-commits" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html

[Index of Archives]     [Kernel Newbies FAQ]     [Kernel Archive]     [IETF Annouce]     [DCCP]     [Netdev]     [Networking]     [Security]     [Bugtraq]     [Photo]     [Yosemite]     [MIPS Linux]     [ARM Linux]     [Linux Security]     [Linux RAID]     [Linux SCSI]

  Powered by Linux