Re: [PATCH 2/3] mm/mseal: limit scope of mseal address zero to address zero

From: Lorenzo Stoakes (ARM)

Date: Fri Jul 17 2026 - 06:54:32 EST


On Fri, Jul 17, 2026 at 11:49:29AM +0100, David Hildenbrand (Arm) wrote:
>
> >> -static inline int do_mseal(unsigned long start, size_t len_in, unsigned long flags)
> >> -{
> >> - /* noop on 32 bit */
> >> - return 0;
> >> -}
> >> +static inline void mseal_mmap_page_zero(void) {}
> >> #endif
> >>
> >> /*
> >> diff --git a/mm/mseal.c b/mm/mseal.c
> >> index 207fea89c61e..5930551d84f2 100644
> >> --- a/mm/mseal.c
> >> +++ b/mm/mseal.c
> >> @@ -32,7 +32,7 @@ static bool range_contains_unmapped(unsigned long start, unsigned long end)
> >> return prev_end < end;
> >> }
> >>
> >> -static int mseal_apply(unsigned long start, unsigned long end)
> >> +static int __mseal(unsigned long start, unsigned long end)
> >> {
> >> struct vm_area_struct *vma, *prev;
> >> VMA_ITERATOR(vmi, current->mm, start);
> >> @@ -66,6 +66,38 @@ static int mseal_apply(unsigned long start, unsigned long end)
> >> return 0;
> >> }
> >>
> >> +static int mseal(unsigned long start, unsigned long end)
> >
> > mseal_range() could be indeed nicer. But do_mseal() is now a pure helper for
> > "SYSCALL_DEFINE3(mseal" only ...could we simply inline do_mseal into
> > SYSCALL_DEFINE3(mseal)?
> >
> > We could do that separately, ofc.

Yeah I do this in 3/3 :P

> >
>
> Forgot
>
> Acked-by: David Hildenbrand (Arm) <david@xxxxxxxxxx>

Thanks :)

>
> --
> Cheers,
>
> David

Cheers, Lorenzo