Skip to content

Commit ffac839

Browse files
Sean Christophersonbonzini
authored andcommitted
KVM: selftests: disable stack protector for all KVM tests
Since 4.8.3, gcc has enabled -fstack-protector by default. This is problematic for the KVM selftests as they do not configure fs or gs segments (the stack canary is pulled from fs:0x28). With the default behavior, gcc will insert a stack canary on any function that creates buffers of 8 bytes or more. As a result, ucall() will hit a triple fault shutdown due to reading a bad fs segment when inserting its stack canary, i.e. every test fails with an unexpected SHUTDOWN. Fixes: 14c47b7 ("kvm: selftests: introduce ucall") Signed-off-by: Sean Christopherson <sean.j.christopherson@intel.com> Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
1 parent 0a3f29b commit ffac839

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tools/testing/selftests/kvm/Makefile

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,8 @@ LIBKVM += $(LIBKVM_$(UNAME_M))
2929
INSTALL_HDR_PATH = $(top_srcdir)/usr
3030
LINUX_HDR_PATH = $(INSTALL_HDR_PATH)/include/
3131
LINUX_TOOL_INCLUDE = $(top_srcdir)/tools/include
32-
CFLAGS += -O2 -g -std=gnu99 -no-pie -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
33-
LDFLAGS += -pthread
32+
CFLAGS += -O2 -g -std=gnu99 -fno-stack-protector -fno-PIE -I$(LINUX_TOOL_INCLUDE) -I$(LINUX_HDR_PATH) -Iinclude -I$(<D) -Iinclude/$(UNAME_M) -I..
33+
LDFLAGS += -pthread -no-pie
3434

3535
# After inclusion, $(OUTPUT) is defined and
3636
# $(TEST_GEN_PROGS) starts with $(OUTPUT)/

0 commit comments

Comments
 (0)