[PATCH v2] ARM: vdso: Define vdso_{start,end} as array

Nathan Lynch nathan_lynch at mentor.com
Wed Aug 23 10:46:28 PDT 2017


Arnd Bergmann <arnd at arndb.de> writes:

> gcc-8 correctly points out that reading four bytes from a pointer to a
> 'char' variable is wrong
>
> arch/arm/kernel/vdso.c: In function 'vdso_init':
> arch/arm/kernel/vdso.c:200:6: error: '__builtin_memcmp_eq' reading 4 bytes from a region of size 1 [-Werror=stringop-overflow=]
>
> However, in this case the variable just stands for the beginning of the
> vdso and is not actually a 'char', so the code is doing what it is meant
> to do.
>
> This uses the same approach as arm64 and x86, declaring the addresses
> as char arrays.
>
> See also: dbbb08f500d6 ("arm64, vdso: Define vdso_{start,end} as array")
>
> Suggested-by: Mark Rutland <mark.rutland at arm.com>
> Suggested-by: Ard Biesheuvel <ard.biesheuvel at linaro.org>
> Signed-off-by: Arnd Bergmann <arnd at arndb.de>

Acked-by: Nathan Lynch <nathan_lynch at mentor.com>

Thanks!



More information about the linux-arm-kernel mailing list