From f2bc8403f417e08982495461e83baaefc5811aab Mon Sep 17 00:00:00 2001 From: Jeff Law Date: Fri, 30 Oct 2020 10:12:34 -0600 Subject: [PATCH] - Re-enable -Wstringop-overflow and instead make the problematical pointer volatile to avoid the false positive diagnostic --- tboot-gcc11.patch | 22 +++++++++++----------- tboot.spec | 6 +++++- 2 files changed, 16 insertions(+), 12 deletions(-) diff --git a/tboot-gcc11.patch b/tboot-gcc11.patch index be993e5..f4ea667 100644 --- a/tboot-gcc11.patch +++ b/tboot-gcc11.patch @@ -67,16 +67,16 @@ index 2974602..8dbcc7c 100644 + unsigned char [16]); #endif /* __RIJNDAEL_H */ -diff --git a/Config.mk b/Config.mk -index 6d2fe14..8234edd 100644 ---- a/Config.mk -+++ b/Config.mk -@@ -74,6 +74,8 @@ TARGET_ARCH ?= $(shell uname -m | sed -e s/i.86/x86_32/ -e s/i86pc/x86_32/) - CFLAGS += $(CFLAGS_WARN) -fno-strict-aliasing -std=gnu99 - # due to bug in gcc v4.2,3,? - CFLAGS += $(call cc-option,$(CC),-Wno-array-bounds,) -+# Due to a bug in gcc-11 -+CFLAGS += $(call cc-option,$(CC),-Wno-stringop-overflow,) +diff --git a/tboot/common/loader.c b/tboot/common/loader.c +index cbb7def..6169564 100644 +--- a/tboot/common/loader.c ++++ b/tboot/common/loader.c +@@ -59,7 +59,7 @@ + #include + /* copy of kernel/VMM command line so that can append 'tboot=0x1234' */ +-static char *new_cmdline = (char *)TBOOT_KERNEL_CMDLINE_ADDR; ++static char * volatile new_cmdline = (char *)TBOOT_KERNEL_CMDLINE_ADDR; - ifeq ($(debug),y) + /* MLE/kernel shared data page (in boot.S) */ + extern tboot_shared_t _tboot_shared; diff --git a/tboot.spec b/tboot.spec index 7b19f8c..4db2ab3 100644 --- a/tboot.spec +++ b/tboot.spec @@ -1,7 +1,7 @@ Summary: Performs a verified launch using Intel TXT Name: tboot Version: 1.9.11 -Release: 4%{?dist} +Release: 5%{?dist} Epoch: 1 License: BSD @@ -66,6 +66,10 @@ make debug=y DISTDIR=$RPM_BUILD_ROOT install /boot/tboot-syms %changelog +* Fri Oct 30 2020 Jeff Law - 1:1.9.11-5 +- Re-enable -Wstringop-overflow and instead make the problematical + pointer volatile to avoid the false positive diagnostic + * Thu Oct 29 2020 Jeff Law - 1:1.9.11-4 - Fix buglet exposed by gcc-11 -Warray-parameter - Temporarily disable -Wstringop-overflow due to false positive in gcc-11