Re: [PATCH 5/5] arm64/vdso: Restrict splitting VVAR VMA

From: Vincenzo Frascino
Date: Mon Feb 24 2020 - 05:07:56 EST


Hi Andrei,

On 2/23/20 11:30 PM, Andrei Vagin wrote:
[...]

>
> Hmmm. I have read the code of special_mapping_mremap() and I don't see where
> it restricts splitting the vvar mapping.
>
> Here is the code what I see in the source:
>
> static int special_mapping_mremap(struct vm_area_struct *new_vma)
> {
> struct vm_special_mapping *sm = new_vma->vm_private_data;
>
> if (WARN_ON_ONCE(current->mm != new_vma->vm_mm))
> return -EFAULT;
>
> if (sm->mremap)
> return sm->mremap(sm, new_vma);
>
> return 0;
> }
>
> And I have checked that without this patch, I can remap only one page of
> the vvar mapping.
>

I checked it a second time and I agree. The check on new_size is required in
this case.

> Thanks,
> Andrei
>

--
Regards,
Vincenzo