Skip to content

Commit

Permalink
Merge pull request #406 from 00xc/redzone
Browse files Browse the repository at this point in the history
libmstpm: disable red zone
  • Loading branch information
00xc authored Jul 5, 2024
2 parents f83352e + fdd5cce commit 6552a8b
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 3 deletions.
2 changes: 1 addition & 1 deletion libmstpm/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -103,7 +103,7 @@ $(LIBTPM): $(MSTPM_MAKEFILE) $(LIBCRYPTO)
$(LIBPLATFORM): $(MSTPM_MAKEFILE) $(LIBCRYPTO)
$(MAKE) -C $(MSTPM_DIR) $(LIBPLATFORM_A)

MSTPM_CFLAGS += -static -nostdinc -fno-stack-protector -fPIE -mno-sse
MSTPM_CFLAGS += -static -nostdinc -fno-stack-protector -fPIE -mno-sse -mno-red-zone
MSTPM_CFLAGS += -DSIMULATION=NO -DFILE_BACKED_NV=NO
MSTPM_CFLAGS += -I$(LIBCRT_DIR)/include
MSTPM_CFLAGS += -I$(OPENSSL_DIR)/include
Expand Down
2 changes: 1 addition & 1 deletion libmstpm/deps/libcrt/Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ else
CFLAGS = -g -O0
endif

CFLAGS += -I./include -nostdinc -nostdlib
CFLAGS += -I./include -nostdinc -nostdlib -mno-red-zone
CFLAGS += -m64 -march=x86-64 -mno-sse2 -fPIE
CFLAGS += -fno-stack-protector
CFLAGS += -ffreestanding
Expand Down
2 changes: 1 addition & 1 deletion libmstpm/deps/openssl_svsm.conf
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ my %targets = (
# exception 6 (invalid opcode) usually in:
# vtpm_init()->libtpm:manufacture()->libcrypto:BN_CTX_new()
release => "-O0"),
"-fPIE -m64 -nostdinc -nostdlib -static -fno-stack-protector")),
"-fPIE -m64 -nostdinc -nostdlib -static -fno-stack-protector -mno-red-zone")),
bn_ops => "SIXTY_FOUR_BIT_LONG",
lib_cppflags => add("-DL_ENDIAN -DNO_SYSLOG -DOPENSSL_SMALL_FOOTPRINT -D_CRT_SECURE_NO_DEPRECATE -D_CRT_NONSTDC_NO_DEPRECATE"),
sys_id => "SVSM"
Expand Down

0 comments on commit 6552a8b

Please sign in to comment.