All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v1] stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish
@ 2018-06-18 12:55 Olaf Hering
  2018-06-18 13:04 ` Samuel Thibault
  0 siblings, 1 reply; 3+ messages in thread
From: Olaf Hering @ 2018-06-18 12:55 UTC (permalink / raw)
  To: xen-devel; +Cc: Wei Liu, Olaf Hering, Ian Jackson, Samuel Thibault

gcc8 spotted this error:
error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]

Signed-off-by: Olaf Hering <olaf@aepfle.de>
---
 stubdom/Makefile                            |  1 +
 stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch | 12 ++++++++++++
 2 files changed, 13 insertions(+)
 create mode 100644 stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch

diff --git a/stubdom/Makefile b/stubdom/Makefile
index cad672f59d..d39d16786b 100644
--- a/stubdom/Makefile
+++ b/stubdom/Makefile
@@ -230,6 +230,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
 	patch -d $@ -p1 < vtpm-cmake-Wextra.patch
 	patch -d $@ -p1 < vtpm-implicit-fallthrough.patch
 	patch -d $@ -p1 < vtpm-cmake_glob_sort.patch
+	patch -d $@ -p1 < vtpm_TPM_ChangeAuthAsymFinish.patch
 	mkdir $@/build
 	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
 	touch $@
diff --git a/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch b/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch
new file mode 100644
index 0000000000..10b89a4c3a
--- /dev/null
+++ b/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch
@@ -0,0 +1,12 @@
+error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
+--- a/tpm/tpm_deprecated.c
++++ b/tpm/tpm_deprecated.c
+@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_
+   tpm_hmac_final(&hmac_ctx, b1.digest);
+   /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
+         indicate a failure if the values do not match. */
+-  if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
++  if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
+     debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
+     return TPM_FAIL;
+   }

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish
  2018-06-18 12:55 [PATCH v1] stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish Olaf Hering
@ 2018-06-18 13:04 ` Samuel Thibault
  2018-06-25  8:52   ` Wei Liu
  0 siblings, 1 reply; 3+ messages in thread
From: Samuel Thibault @ 2018-06-18 13:04 UTC (permalink / raw)
  To: Olaf Hering; +Cc: Wei Liu, Ian Jackson, xen-devel

Olaf Hering, le lun. 18 juin 2018 14:55:36 +0200, a ecrit:
> gcc8 spotted this error:
> error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
> 
> Signed-off-by: Olaf Hering <olaf@aepfle.de>

Indeed!

Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

> ---
>  stubdom/Makefile                            |  1 +
>  stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch | 12 ++++++++++++
>  2 files changed, 13 insertions(+)
>  create mode 100644 stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch
> 
> diff --git a/stubdom/Makefile b/stubdom/Makefile
> index cad672f59d..d39d16786b 100644
> --- a/stubdom/Makefile
> +++ b/stubdom/Makefile
> @@ -230,6 +230,7 @@ tpm_emulator-$(XEN_TARGET_ARCH): tpm_emulator-$(TPMEMU_VERSION).tar.gz
>  	patch -d $@ -p1 < vtpm-cmake-Wextra.patch
>  	patch -d $@ -p1 < vtpm-implicit-fallthrough.patch
>  	patch -d $@ -p1 < vtpm-cmake_glob_sort.patch
> +	patch -d $@ -p1 < vtpm_TPM_ChangeAuthAsymFinish.patch
>  	mkdir $@/build
>  	cd $@/build; CC=${CC} $(CMAKE) .. -DCMAKE_C_FLAGS:STRING="-std=c99 -DTPM_NO_EXTERN $(TARGET_CPPFLAGS) $(TARGET_CFLAGS) -Wno-declaration-after-statement"
>  	touch $@
> diff --git a/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch b/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch
> new file mode 100644
> index 0000000000..10b89a4c3a
> --- /dev/null
> +++ b/stubdom/vtpm_TPM_ChangeAuthAsymFinish.patch
> @@ -0,0 +1,12 @@
> +error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
> +--- a/tpm/tpm_deprecated.c
> ++++ b/tpm/tpm_deprecated.c
> +@@ -434,7 +434,7 @@ TPM_RESULT TPM_ChangeAuthAsymFinish(TPM_
> +   tpm_hmac_final(&hmac_ctx, b1.digest);
> +   /* 6. The TPM SHALL compare b1 with newAuthLink. The TPM SHALL
> +         indicate a failure if the values do not match. */
> +-  if (memcmp(&b1, &newAuthLink, sizeof(TPM_HMAC))) {
> ++  if (memcmp(&b1, newAuthLink, sizeof(TPM_HMAC))) {
> +     debug("TPM_ChangeAuthAsymFinish(): newAuthLink value does not match.");
> +     return TPM_FAIL;
> +   }
> 

-- 
Samuel
...
<rv_> et Ctrl alt F2 pour aller sous console
<rv_> mais c koi pour passer d'un bureau a un autre !
<rv_> au fait c koi le raccourci pour passer d'un bureau a un autre 'question stupide"
<cycyx> ça dépend du window manager et de ta conf
<Firebird> ce qui fonctionne toujours c'est CTRL-ALT-BCKSP
-:- SignOff rv_: #linuxfr (Read error: EOF from client)
-:- rv_ [~rv@217.11.166.169] has joined #linuxfr
<rv_> Firebird: MEURT...

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [PATCH v1] stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish
  2018-06-18 13:04 ` Samuel Thibault
@ 2018-06-25  8:52   ` Wei Liu
  0 siblings, 0 replies; 3+ messages in thread
From: Wei Liu @ 2018-06-25  8:52 UTC (permalink / raw)
  To: Samuel Thibault, Olaf Hering, xen-devel, Ian Jackson, Wei Liu

On Mon, Jun 18, 2018 at 03:04:46PM +0200, Samuel Thibault wrote:
> Olaf Hering, le lun. 18 juin 2018 14:55:36 +0200, a ecrit:
> > gcc8 spotted this error:
> > error: 'memcmp' reading 20 bytes from a region of size 8 [-Werror=stringop-overflow=]
> > 
> > Signed-off-by: Olaf Hering <olaf@aepfle.de>
> 
> Indeed!
> 
> Reviewed-by: Samuel Thibault <samuel.thibault@ens-lyon.org>

Thanks, I will apply this patch once the tree is open.

Wei.

_______________________________________________
Xen-devel mailing list
Xen-devel@lists.xenproject.org
https://lists.xenproject.org/mailman/listinfo/xen-devel

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2018-06-25  8:52 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-06-18 12:55 [PATCH v1] stubdom/vtpm: fix memcmp in TPM_ChangeAuthAsymFinish Olaf Hering
2018-06-18 13:04 ` Samuel Thibault
2018-06-25  8:52   ` Wei Liu

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.