From 3763ace740ed63e895df27973ef28f0bfd227559 Mon Sep 17 00:00:00 2001 From: Nathan Chancellor Date: Thu, 14 May 2020 03:31:14 -0700 Subject: [PATCH] ANDROID: arm64: vdso: Fix removing SCS flags Commit 6545d64a18f7 ("BACKPORT: arm64: vdso: Substitute gettimeofday() with C implementation") added an assignment to CFLAGS_REMOVE_vgettimeofday.o without adjusting the existing one for the removal of the shadow call stack flags. Without this patch, the SCS flags do not get filtered: clang ... -g -fsanitize=shadow-call-stack -Wdeclaration-after-statement ... -c -o arch/arm64/kernel/vdso/.tmp_vgettimeofday.o ... After this, everything works as it should: clang ... -g -Wdeclaration-after-statement -Wno-pointer-sign ... -c -o arch/arm64/kernel/vdso/.tmp_vgettimeofday.o ... This is an Android specific issue to the backport of the above patch, this issue will not be present in the mainline version of SCS. Change-Id: I2ff00e1b407155501ada4c36a961db0b720b80bf Fixes: 6545d64a18f7 ("BACKPORT: arm64: vdso: Substitute gettimeofday() with C implementation") Signed-off-by: Nathan Chancellor --- arch/arm64/kernel/vdso/Makefile | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/arch/arm64/kernel/vdso/Makefile b/arch/arm64/kernel/vdso/Makefile index d63cbd2ff4d7..f2eb6ad713fb 100644 --- a/arch/arm64/kernel/vdso/Makefile +++ b/arch/arm64/kernel/vdso/Makefile @@ -21,14 +21,12 @@ ldflags-y := -shared -nostdlib -soname=linux-vdso.so.1 --hash-style=sysv \ --build-id -n -T ccflags-y += $(DISABLE_LTO) -CFLAGS_REMOVE_vgettimeofday.o += $(CC_FLAGS_SCS) - ccflags-y := -fno-common -fno-builtin -fno-stack-protector ccflags-y += -DDISABLE_BRANCH_PROFILING VDSO_LDFLAGS := -Bsymbolic -CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os +CFLAGS_REMOVE_vgettimeofday.o = $(CC_FLAGS_FTRACE) -Os $(CC_FLAGS_SCS) KBUILD_CFLAGS += $(DISABLE_LTO) KASAN_SANITIZE := n UBSAN_SANITIZE := n