diff options
author | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
---|---|---|
committer | Jason M. Bills <jason.m.bills@linux.intel.com> | 2020-12-08 00:38:17 +0300 |
commit | 8d6ae7f2a817751fad151168fa10ce28ee0869d8 (patch) | |
tree | 281032f7ec07c41589aa094bd165cc2a98f2d3a7 /meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch | |
parent | c16fb8893b19075db4bcf3b5bf33c1db8c3ca2bd (diff) | |
parent | 5da3c2284560a7e08ffafd03c5b5ba44a3242228 (diff) | |
download | openbmc-8d6ae7f2a817751fad151168fa10ce28ee0869d8.tar.xz |
Merge tag '0.26' of ssh://git-amr-1.devtools.intel.com:29418/openbmc-openbmc into update
Diffstat (limited to 'meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch')
-rw-r--r-- | meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch b/meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch new file mode 100644 index 000000000..f2938e0e0 --- /dev/null +++ b/meta-security/meta-tpm/recipes-tpm2/ibmswtpm2/files/fix-wrong-cast.patch @@ -0,0 +1,27 @@ +Fix strict aliasing issue of gcc10 + +fixes: + +TpmFail.c: In function 'TpmLogFailure': +TpmFail.c:217:23: error: dereferencing type-punned pointer will break strict-aliasing rules [-Werror=strict-aliasing] + 217 | s_failFunction = *(UINT32 *)&function; /* kgold */ + | ^~~~~~~~~~~~~~~~~~~ +cc1: all warnings being treated as errors + +Upstream-Status: Submitted + +Signed-off-by: Jens Rehsack <sno@NetBSD.org> + +Index: src/TpmFail.c +=================================================================== +--- src.orig/TpmFail.c 2020-09-10 15:43:57.085063875 +0200 ++++ src/TpmFail.c 2020-09-10 15:48:35.563302634 +0200 +@@ -214,7 +214,7 @@ + // On a 64-bit machine, this may truncate the address of the string + // of the function name where the error occurred. + #if FAIL_TRACE +- s_failFunction = *(UINT32 *)&function; /* kgold */ ++ memcpy(&s_failFunction, function, sizeof(uint32_t)); /* kgold */ + s_failLine = line; + #else + s_failFunction = 0; |