Re: [PATCH 2/3] mm/mseal: limit scope of mseal address zero to address zero
From: David Hildenbrand (Arm)
Date: Fri Jul 17 2026 - 06:41:28 EST
>>
>>> {
>>> 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)
>>
>> I don't like that you go start - end on a function called "mseal". The actual
>> system call goes start - len. It just looks confusing :) So either rename it
>> to mseal_range(), or make it take a start, length pair.
>
> I'm not sure I really understand the confusion (I suppose you're equally
> confused by the lack of flags parameter?),
>
> I find it silly that we avoid function names because a system call of the same
> name exists.
>
> But I guess I can rename it to mseal_range() since I don't want the series
> blocked on silly naming issues.
I think we typically have a XXX call do_XXX, like with mprotect(). But not sure
if there is a real rule to that, I'm sure there are exceptions. At least it's
only an internal helper.
Just like with the "__*" functions, sometimes it indeed helps to just have a
better description that shows the difference. But sometimes it's just really
hard to name or restructure stuff.
I think the page fault logic is especially hard to follow with things like
do_fault() and __do_fault(), whereby we have another layer of do_read_fault()
etc in-between :)
--
Cheers,
David