[PATCH] mm/mseal: Fix range_contains_unmapped() ignoring its mm argument
From: Hongfu Li
Date: Thu Jul 16 2026 - 05:36:44 EST
From: Hongfu Li <lihongfu@xxxxxxxxxx>
range_contains_unmapped() accepts an explicit struct mm_struct *mm
argument, yet hardcodes current->mm inside VMA_ITERATOR(), ignoring
the passed address space.
Its only caller do_mseal() currently passes current->mm, so the bug
does not manifest right now. However this mismatch between prototype
and implementation is a latent bug.
Replace current->mm with the passed mm parameter to match the
function prototype.
Fixes: 530e09096413 ("mm/mseal: simplify and rename VMA gap check")
Signed-off-by: Hongfu Li <lihongfu@xxxxxxxxxx>
---
mm/mseal.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/mm/mseal.c b/mm/mseal.c
index 9781647483d1..8d82e50900ba 100644
--- a/mm/mseal.c
+++ b/mm/mseal.c
@@ -41,7 +41,7 @@ static bool range_contains_unmapped(struct mm_struct *mm,
{
struct vm_area_struct *vma;
unsigned long prev_end = start;
- VMA_ITERATOR(vmi, current->mm, start);
+ VMA_ITERATOR(vmi, mm, start);
for_each_vma_range(vmi, vma, end) {
if (vma->vm_start > prev_end)
--
2.54.0