This is the mail archive of the
libc-alpha@sourceware.org
mailing list for the glibc project.
Re: [PATCH 18/19] arm64:ilp32: add vdso-ilp32 and use for signal return
- From: Andreas Schwab <schwab at suse dot de>
- To: Yury Norov <ynorov at caviumnetworks dot com>
- Cc: <arnd at arndb dot de>, <catalin dot marinas at arm dot com>, <linux-arm-kernel at lists dot infradead dot org>, <linux-kernel at vger dot kernel dot org>, <linux-doc at vger dot kernel dot org>, <linux-arch at vger dot kernel dot org>, <libc-alpha at sourceware dot org>, <schwidefsky at de dot ibm dot com>, <heiko dot carstens at de dot ibm dot com>, <pinskia at gmail dot com>, <broonie at kernel dot org>, <joseph at codesourcery dot com>, <christoph dot muellner at theobroma-systems dot com>, <bamvor dot zhangjian at huawei dot com>, <szabolcs dot nagy at arm dot com>, <klimov dot linux at gmail dot com>, <Nathan_Lynch at mentor dot com>, <agraf at suse dot de>, <Prasun dot Kapoor at caviumnetworks dot com>, <kilobyte at angband dot pl>, <geert at linux-m68k dot org>, <philipp dot tomsich at theobroma-systems dot com>, <manuel dot montezelo at gmail dot com>, <linyongting at huawei dot com>, <maxim dot kuvyrkov at linaro dot org>, <davem at davemloft dot net>
- Date: Mon, 20 Jun 2016 16:54:17 +0200
- Subject: Re: [PATCH 18/19] arm64:ilp32: add vdso-ilp32 and use for signal return
- Authentication-results: sourceware.org; auth=none
- References: <1466207668-10549-1-git-send-email-ynorov at caviumnetworks dot com> <1466207668-10549-19-git-send-email-ynorov at caviumnetworks dot com>
Yury Norov <ynorov@caviumnetworks.com> writes:
> diff --git a/arch/arm64/kernel/vdso.c b/arch/arm64/kernel/vdso.c
> index 2a0de6f..e48ea34 100644
> --- a/arch/arm64/kernel/vdso.c
> +++ b/arch/arm64/kernel/vdso.c
> @@ -40,6 +40,12 @@ extern char vdso_start, vdso_end;
> static unsigned long vdso_pages;
> static struct page **vdso_pagelist;
>
> +#ifdef CONFIG_ARM64_ILP32
> +extern char vdso_ilp32_start, vdso_ilp32_end;
> +static unsigned long vdso_ilp32_pages;
> +static struct page **vdso_ilp32_pagelist;
> +#endif
> +
> /*
> * The vDSO data page.
> */
> @@ -110,24 +116,29 @@ int aarch32_setup_vectors_page(struct linux_binprm *bprm, int uses_interp)
> }
> #endif /* CONFIG_AARCH32_EL0 */
>
> -static struct vm_special_mapping vdso_spec[2];
> -
> -static int __init vdso_init(void)
> +static int __init vdso_init_common(char *vdso_start, char *vdso_end,
Using the same name for the parameter as for the global variable is
dangerous ....
> + unsigned long *vdso_pagesp,
> + struct page ***vdso_pagelistp,
> + struct vm_special_mapping* vdso_spec)
> {
> int i;
> + unsigned long vdso_pages;
> + struct page **vdso_pagelist;
>
> - if (memcmp(&vdso_start, "\177ELF", 4)) {
> + if (memcmp(vdso_start, "\177ELF", 4)) {
... because forgetting to remove & can be fatal, and your compiler may
not even warn you.
Andreas.
--
Andreas Schwab, SUSE Labs, schwab@suse.de
GPG Key fingerprint = 0196 BAD8 1CE9 1970 F4BE 1748 E4D4 88E3 0EEA B9D7
"And now for something completely different."