s390/vdso: filter out -mstack-guard and -mstack-size
authorSven Schnelle <svens@linux.ibm.com>
Thu, 11 Nov 2021 09:58:26 +0000 (10:58 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Nov 2021 08:48:45 +0000 (09:48 +0100)
commitcc8b2e0d5bd75b67d7ee24de2685d2ee3d28e2d9
tree82aa1ac2c77f52632881e4f702eda824f863dfe0
parent44b6cc4367cc6f9c3803bd19df509ae7c1e3496e
s390/vdso: filter out -mstack-guard and -mstack-size

commit 00b55eaf45549ce26424224d069a091c7e5d8bac upstream.

When CONFIG_VMAP_STACK is disabled, the user can enable CONFIG_STACK_CHECK,
which adds a stack overflow check to each C function in the kernel. This is
also done for functions in the vdso page. These functions are run in user
context and user stack sizes are usually different to what the kernel uses.
This might trigger the stack check although the stack size is valid.
Therefore filter the -mstack-guard and -mstack-size flags when compiling
vdso C files.

Cc: stable@kernel.org # 5.10+
Fixes: 4bff8cb54502 ("s390: convert to GENERIC_VDSO")
Reported-by: Janosch Frank <frankja@linux.ibm.com>
Signed-off-by: Sven Schnelle <svens@linux.ibm.com>
Reviewed-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Heiko Carstens <hca@linux.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
arch/s390/Makefile
arch/s390/kernel/vdso64/Makefile