Re: [PATCH 18/30] cr: restore vDSO on i386/x86_64

From: Serge E. Hallyn
Date: Thu Apr 16 2009 - 11:28:05 EST


Quoting Alexey Dobriyan (adobriyan@xxxxxxxxx):
> FIXME: check VMA has same parameters.
> FIXME: abort if target kernel has vDSO disabled (?)
> FIXME: restore pages, vDSO is writable after all.
>
> Signed-off-by: Alexey Dobriyan <adobriyan@xxxxxxxxx>
> ---
>
> arch/x86/vdso/vdso32-setup.c | 6 ++
> include/linux/cr.h | 11 +++++
> include/linux/mm.h | 5 +-
> kernel/cr/cr-mm.c | 87 +++++++++++++++++++++++++++++++++++++++++++
> mm/mmap.c | 3 +
> 5 files changed, 110 insertions(+), 2 deletions(-)
>
> --- a/arch/x86/vdso/vdso32-setup.c
> +++ b/arch/x86/vdso/vdso32-setup.c
> @@ -328,6 +328,10 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, unsigned long start,
>
> map_compat_vdso(compat);
>
> + if (start) {
> + addr = start;
> + goto map;
> + }

Hmm, is there any safety to be gained by using
arch_get_unmapped_area(NULL, start, PAGE_SIZE, 0, 0);
so as to make sure there is a free page?

> if (compat)
> addr = VDSO_HIGH_BASE;
> else {
> @@ -337,7 +341,7 @@ int arch_setup_additional_pages(struct linux_binprm *bprm, unsigned long start,
> goto up_fail;
> }
> }
> -
> +map:
> if (compat_uses_vma || !compat) {
> /*
> * MAYWRITE to allow gdb to COW and set breakpoints

thanks,
-serge
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/