[alternative-merged] mm-mempolicy-allow-lookup_node-to-handle-fatal-signal.patch removed from -mm tree

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

 



The patch titled
     Subject: mm/mempolicy: allow lookup_node() to handle fatal signal
has been removed from the -mm tree.  Its filename was
     mm-mempolicy-allow-lookup_node-to-handle-fatal-signal.patch

This patch was dropped because an alternative patch was merged

------------------------------------------------------
From: Peter Xu <peterx@xxxxxxxxxx>
Subject: mm/mempolicy: allow lookup_node() to handle fatal signal

lookup_node() uses gup to pin the page and get node information.  It
checks against ret>=0 assuming the page will be filled in.  However it's
also possible that gup will return zero, for example, when the thread is
quickly killed with a fatal signal.  Teach lookup_node() to gracefully
return an error -EFAULT if it happens.

Link: http://lkml.kernel.org/r/20200407004745.GA48345@xz-x1
Fixes: 4426e945df58 ("mm/gup: allow VM_FAULT_RETRY for multiple times")
Signed-off-by: Peter Xu <peterx@xxxxxxxxxx>
Reported-by: syzbot+693dc11fcb53120b5559@xxxxxxxxxxxxxxxxxxxxxxxxx
Reviewed-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
Signed-off-by: Andrew Morton <akpm@xxxxxxxxxxxxxxxxxxxx>
---

 mm/mempolicy.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--- a/mm/mempolicy.c~mm-mempolicy-allow-lookup_node-to-handle-fatal-signal
+++ a/mm/mempolicy.c
@@ -901,7 +901,10 @@ static int lookup_node(struct mm_struct
 
 	int locked = 1;
 	err = get_user_pages_locked(addr & PAGE_MASK, 1, 0, &p, &locked);
-	if (err >= 0) {
+	if (err == 0) {
+		/* E.g. GUP interupted by fatal signal */
+		err = -EFAULT;
+	} else if (err > 0) {
 		err = page_to_nid(p);
 		put_page(p);
 	}
_

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

mm-gup-mark-lock-taken-only-after-a-successful-retake.patch




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

  Powered by Linux