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)
committerHeiko Carstens <hca@linux.ibm.com>
Tue, 16 Nov 2021 11:29:19 +0000 (12:29 +0100)
commit00b55eaf45549ce26424224d069a091c7e5d8bac
tree15e458607b3029c418c73bbc933ed29d63e8c825
parent7b737adc10d269e7fdf714ae2caa2281b6a801cf
s390/vdso: filter out -mstack-guard and -mstack-size

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>
arch/s390/Makefile
arch/s390/kernel/vdso64/Makefile