Skip to contentSkip to conversation

uprobes-__replace_page-avoid-bug-in-munlock_vma_page.patch removed from -mm tree

merged [email protected] 1 participant 1 message Aug 22, 2020 Stable branch

lore
Share & tools
lore

[email protected]

author tree notice Applied
#0 lore raw

The patch titled
Subject: uprobes: __replace_page() avoid BUG in munlock_vma_page()
has been removed from the -mm tree. Its filename was
uprobes-__replace_page-avoid-bug-in-munlock_vma_page.patch

This patch was dropped because it was merged into mainline or a subsystem tree

------------------------------------------------------
From: Hugh Dickins <[email protected]>
Subject: uprobes: __replace_page() avoid BUG in munlock_vma_page()

syzbot crashed on the VM_BUG_ON_PAGE(PageTail) in munlock_vma_page(), when called from uprobes __replace_page(). Which of many ways to fix it? Settled on not calling when PageCompound (since Head and Tail are equals in this context, PageCompound the usual check in uprobes.c, and the prior use of FOLL_SPLIT_PMD will have cleared PageMlocked already).

---

 kernel/events/uprobes.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
kernel/events/uprobes.c renamed from kernel/events/uprobes.c~uprobes-__replace_page-avoid-bug-in-munlock_vma_page +1 -1
@@ -205,7 +205,7 @@ static int __replace_page(struct vm_area
 		try_to_free_swap(old_page);
 	page_vma_mapped_walk_done(&pvmw);
 
-	if (vma->vm_flags & VM_LOCKED)
+	if ((vma->vm_flags & VM_LOCKED) && !PageCompound(old_page))
 		munlock_vma_page(old_page);
 	put_page(old_page);
 

_

Patches currently in -mm which might be from [email protected] are