[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20200223233013.GB349924@gmail.com>
Date: Sun, 23 Feb 2020 15:30:13 -0800
From: Andrei Vagin <avagin@...il.com>
To: Vincenzo Frascino <vincenzo.frascino@....com>
Cc: linux-arm-kernel@...ts.infradead.org, linux-kernel@...r.kernel.org,
Thomas Gleixner <tglx@...utronix.de>,
Dmitry Safonov <dima@...sta.com>
Subject: Re: [PATCH 5/5] arm64/vdso: Restrict splitting VVAR VMA
On Thu, Feb 20, 2020 at 12:22:52PM +0000, Vincenzo Frascino wrote:
> Hi Andrei,
>
> On 04/02/2020 17:59, Andrei Vagin wrote:
> > Forbid splitting VVAR VMA resulting in a stricter ABI and reducing the
> > amount of corner-cases to consider while working further on VDSO time
> > namespace support.
> >
> > As the offset from timens to VVAR page is computed compile-time, the pages
> > in VVAR should stay together and not being partically mremap()'ed.
> >
>
> I agree on the concept, but why do we need to redefine mremap?
> special_mapping_mremap() (mm/mmap.c +3317) seems doing already the same thing if
> we leave mremap == NULL as is.
>
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.
Thanks,
Andrei
Powered by blists - more mailing lists