Skip to contentSkip to conversation

mm/mmap: Fix VM_LOCKED check in do_vmi_align_munmap()

PATCH In review Suren Baghdasaryan 2 participants 2 messages Jul 11, 2023 Stable branch

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 mm/mmap: Fix VM_LOCKED check in do_vmi_align_munmap()

6.1 backport of the patch [1] uses 'next' vma instead of 'split' vma. Fix the mistake.

[1] commit 606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()")

Fixes a149174ff8bb ("mm/mmap: Fix error path in do_vmi_align_munmap()")
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mmap.c +1 -1
index b8af52db3bbe..1597a96b667f 100644
@@ -2484,7 +2484,7 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
 			error = mas_store_gfp(&mas_detach, split, GFP_KERNEL);
 			if (error)
 				goto munmap_gather_failed;
-			if (next->vm_flags & VM_LOCKED)
+			if (split->vm_flags & VM_LOCKED)
 				locked_vm += vma_pages(split);
 
 			count++;
Signature · 1 line
2.41.0.390.g38632f3daf-goog
maintainer
#1 lore raw
Quoted 28 lines · Suren Baghdasaryan

6.1 backport of the patch [1] uses 'next' vma instead of 'split' vma. Fix the mistake.

[1] commit 606c812eb1d5 ("mm/mmap: Fix error path in do_vmi_align_munmap()")

Fixes a149174ff8bb ("mm/mmap: Fix error path in do_vmi_align_munmap()")
---
 mm/mmap.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
mm/mmap.c +1 -1
index b8af52db3bbe..1597a96b667f 100644
@@ -2484,7 +2484,7 @@ do_mas_align_munmap(struct ma_state *mas, struct vm_area_struct *vma,
 			error = mas_store_gfp(&mas_detach, split, GFP_KERNEL);
 			if (error)
 				goto munmap_gather_failed;
-			if (next->vm_flags & VM_LOCKED)
+			if (split->vm_flags & VM_LOCKED)
 				locked_vm += vma_pages(split);
 
 			count++;
Signature · 1 line
2.41.0.390.g38632f3daf-goog

Thanks, now queued up.

greg k-h