diff options
author | Christopher Clark <christopher.w.clark@gmail.com> | 2018-07-31 12:35:44 -0700 |
---|---|---|
committer | Bruce Ashfield <bruce.ashfield@windriver.com> | 2018-08-02 22:57:14 -0400 |
commit | f9650d8997505796883d0ef61bd8ad2a87c2b36e (patch) | |
tree | a0b311551dea8026da5020e5cfb6eaaa7ddab2ee | |
parent | 9418f68a4483eddbbaae1ade35f3b34340a2bf79 (diff) | |
download | meta-virtualization-f9650d8997505796883d0ef61bd8ad2a87c2b36e.tar.gz |
tpm-emulator: apply patch to fix memcmp defect found by gcc
| tpm_emulator-0.7.4/tpm/tpm_deprecated.c:437:7:
| error: 'memcmp' reading 20 bytes from a region of size 8
| [-Werror=stringop-overflow=]
| if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
| ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
Apply patch from Xen: vtpm_TPM_ChangeAuthAsymFinish.patch
Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com>
Signed-off-by: Bruce Ashfield <bruce.ashfield@windriver.com>
-rw-r--r-- | recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch | 28 | ||||
-rw-r--r-- | recipes-extended/xen/tpm-emulator_0.7.4.bb | 1 |
2 files changed, 29 insertions, 0 deletions
diff --git a/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch b/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch new file mode 100644 index 00000000..aefca284 --- /dev/null +++ b/recipes-extended/xen/files/vtpm_TPM_ChangeAuthAsymFinish.patch | |||
@@ -0,0 +1,28 @@ | |||
1 | Patch derived from below Xen changeset. | ||
2 | Signed-off-by: Christopher Clark <christopher.clark6@baesystems.com> | ||
3 | |||
4 | commit 22bf5be3237cb482a2ffd772ffd20ce37285eebf | ||
5 | Author: Olaf Hering <olaf@aepfle.de> | ||
6 | Date: Mon Jun 18 14:55:36 2018 +0200 | ||
7 | |||
8 | stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish | ||
9 | |||
10 | gcc8 spotted this error: | ||
11 | error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=] | ||
12 | |||
13 | Signed-off-by: Olaf Hering <olaf@aepfle.de> | ||
14 | Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org> | ||
15 | |||
16 | diff --git a/tpm/tpm_deprecated.c b/tpm/tpm_deprecated.c | ||
17 | index c362b56..4c49f54 100644 | ||
18 | --- a/tpm/tpm_deprecated.c | ||
19 | +++ b/tpm/tpm_deprecated.c | ||
20 | @@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_KEY_HANDLE parentHandle, | ||
21 | tpm_hmac_final(&hmac_ctx, b1.digest); | ||
22 | /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL | ||
23 | indicate a failure if the values do not match. */ | ||
24 | - if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) { | ||
25 | + if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) { | ||
26 | debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match."); | ||
27 | return TPM_FAIL; | ||
28 | } | ||
diff --git a/recipes-extended/xen/tpm-emulator_0.7.4.bb b/recipes-extended/xen/tpm-emulator_0.7.4.bb index f6269297..96a40905 100644 --- a/recipes-extended/xen/tpm-emulator_0.7.4.bb +++ b/recipes-extended/xen/tpm-emulator_0.7.4.bb | |||
@@ -16,6 +16,7 @@ SRC_URI = "\ | |||
16 | file://vtpm-deepquote-anyloc.patch \ | 16 | file://vtpm-deepquote-anyloc.patch \ |
17 | file://vtpm-cmake-Wextra.patch \ | 17 | file://vtpm-cmake-Wextra.patch \ |
18 | file://vtpm-implicit-fallthrough.patch \ | 18 | file://vtpm-implicit-fallthrough.patch \ |
19 | file://vtpm_TPM_ChangeAuthAsymFinish.patch \ | ||
19 | " | 20 | " |
20 | SRC_URI[tpm-emulator.md5sum] = "e26becb8a6a2b6695f6b3e8097593db8" | 21 | SRC_URI[tpm-emulator.md5sum] = "e26becb8a6a2b6695f6b3e8097593db8" |
21 | SRC_URI[tpm-emulator.sha256sum] = "4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459" | 22 | SRC_URI[tpm-emulator.sha256sum] = "4e48ea0d83dd9441cc1af04ab18cd6c961b9fa54d5cbf2c2feee038988dea459" |