On 4/25/19 7:41 PM, Jann Horn wrote: > On Thu, Apr 25, 2019 at 6:17 PM Dmitry Safonov <[email protected]> wrote: >> Although, time namespace can work with VVAR VMA split, it seems worth >> to forbid splitting VVAR resulting in stricter ABI and reducing amount >> of corner-cases to consider while working further on VDSO. > [...] >> diff --git a/arch/x86/entry/vdso/vma.c b/arch/x86/entry/vdso/vma.c >> index babc4e7a519c..ff9875a4d53b 100644 >> --- a/arch/x86/entry/vdso/vma.c >> +++ b/arch/x86/entry/vdso/vma.c > [...] >> +static int vvar_mremap(const struct vm_special_mapping *sm, >> + struct vm_area_struct *new_vma) >> +{ >> + unsigned long new_size = new_vma->vm_end - new_vma->vm_start; >> + const struct vdso_image *image = current->mm->context.vdso_image; > > Using current->mm in here is a bit awkward. So far the ->mremap > handler can only be invoked for `current`, but still, maybe > new_vma->vm_mm would be better here? Yep, can do - also in vdso_mremap(). Though, it should be only stylistic as it's checked in special_mapping_mremap() to be the same. > >> + if (new_size != -image->sym_vvar_start) >> + return -EINVAL; >> + >> + return 0; >> +} > [...] > Thanks, Dima
- [PATCHv3 19/27] timens/fs/proc: Introduce /proc/pid/timens... Dmitry Safonov
- [PATCHv3 13/27] x86/vdso: Rename vdso_image {.data=>.te... Dmitry Safonov
- [PATCHv3 15/27] x86/vdso: Allocate timens vdso Dmitry Safonov
- Re: [PATCHv3 15/27] x86/vdso: Allocate timens vdso Jann Horn
- Re: [PATCHv3 15/27] x86/vdso: Allocate timens vds... Dmitry Safonov
- [PATCHv3 17/27] vdso: introduce timens_static_branch Dmitry Safonov
- [PATCHv3 14/27] x86/vdso: Add offsets page in vvar Dmitry Safonov
- [PATCHv3 12/27] x86/vdso: Restrict splitting VVAR VMA Dmitry Safonov
- Re: [PATCHv3 12/27] x86/vdso: Restrict splitting VVAR... Jann Horn
- Re: [PATCHv3 12/27] x86/vdso: Restrict splitting ... Dmitry Safonov
- [PATCHv3 10/27] x86/vdso2c: Convert iterator to unsigned Dmitry Safonov
- [PATCHv3 06/27] posix-timers/timens: Take into account clo... Dmitry Safonov
- Re: [PATCHv3 06/27] posix-timers/timens: Take into ac... Thomas Gleixner
- [PATCHv3 07/27] timens/kernel: Take into account timens cl... Dmitry Safonov
- [PATCHv3 08/27] timens: Shift /proc/uptime Dmitry Safonov
- [PATCHv3 05/27] timerfd/timens: Take into account ns clock... Dmitry Safonov
- Re: [PATCHv3 05/27] timerfd/timens: Take into account... Thomas Gleixner
- [PATCHv3 03/27] timens: Introduce CLOCK_MONOTONIC offsets Dmitry Safonov
- Re: [PATCHv3 03/27] timens: Introduce CLOCK_MONOTONIC... Thomas Gleixner

