[yocto] [meta-security][PATCH] libtpm: Fix arm build issues
Armin Kuster
akuster808 at gmail.com
Sat Feb 18 11:28:51 PST 2017
backport two upstream patches and remove local verison
Signed-off-by: Armin Kuster <akuster808 at gmail.com>
---
.../Convert-another-vdprintf-to-dprintf.patch | 26 +++++++++++++++++
.../files/Use-format-s-for-call-to-dprintf.patch | 33 ++++++++++++++++++++++
recipes-tpm/libtpm/files/fix_dprintf_issue.patch | 18 ------------
recipes-tpm/libtpm/libtpm_1.0.bb | 3 +-
4 files changed, 61 insertions(+), 19 deletions(-)
create mode 100644 recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch
create mode 100644 recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch
delete mode 100644 recipes-tpm/libtpm/files/fix_dprintf_issue.patch
diff --git a/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch b/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch
new file mode 100644
index 0000000..9e1021a
--- /dev/null
+++ b/recipes-tpm/libtpm/files/Convert-another-vdprintf-to-dprintf.patch
@@ -0,0 +1,26 @@
+From 09e7dd42e5201d079bad70e9f7cc6033ce1c7cad Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb at linux.vnet.ibm.com>
+Date: Fri, 3 Feb 2017 10:58:22 -0500
+Subject: [PATCH] Convert another vdprintf to dprintf
+
+Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
+Upstream-Status: Backport
+Signed-off-by: Armin Kuster <akuster at mvista.com>
+
+---
+ src/tpm_library.c | 2 +-
+ 1 file changed, 1 insertion(+), 1 deletion(-)
+
+Index: git/src/tpm_library.c
+===================================================================
+--- git.orig/src/tpm_library.c
++++ git/src/tpm_library.c
+@@ -427,7 +427,7 @@ void TPMLIB_LogPrintfA(unsigned int inde
+ indent = sizeof(spaces) - 1;
+ memset(spaces, ' ', indent);
+ spaces[indent] = 0;
+- vdprintf(debug_fd, spaces, NULL);
++ dprintf(debug_fd, "%s", spaces);
+ }
+
+ va_start(args, format);
diff --git a/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch b/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch
new file mode 100644
index 0000000..a71b5c1
--- /dev/null
+++ b/recipes-tpm/libtpm/files/Use-format-s-for-call-to-dprintf.patch
@@ -0,0 +1,33 @@
+From 6a9b4e5d70f770aa9ca31e3e6d3b1ae72c192070 Mon Sep 17 00:00:00 2001
+From: Stefan Berger <stefanb at linux.vnet.ibm.com>
+Date: Tue, 31 Jan 2017 20:10:51 -0500
+Subject: [PATCH] Use format '%s' for call to dprintf
+
+Fix the dprintf call to use a format parameter that otherwise causes
+errors with gcc on certain platforms.
+
+Signed-off-by: Stefan Berger <stefanb at linux.vnet.ibm.com>
+
+Upstream-Status: Backport
+replaces local patch
+Signed-off-by: Armin Kuster <akuster at mvsita.com>
+
+---
+ src/tpm_library.c | 4 ++--
+ 1 file changed, 2 insertions(+), 2 deletions(-)
+
+Index: git/src/tpm_library.c
+===================================================================
+--- git.orig/src/tpm_library.c
++++ git/src/tpm_library.c
+@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format,
+ }
+
+ if (debug_prefix)
+- dprintf(debug_fd, debug_prefix);
+- dprintf(debug_fd, buffer);
++ dprintf(debug_fd, "%s", debug_prefix);
++ dprintf(debug_fd, "%s", buffer);
+
+ return i;
+ }
diff --git a/recipes-tpm/libtpm/files/fix_dprintf_issue.patch b/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
deleted file mode 100644
index 25760bb..0000000
--- a/recipes-tpm/libtpm/files/fix_dprintf_issue.patch
+++ /dev/null
@@ -1,18 +0,0 @@
-Upstream-Status: Pending
-Signed-off-by: Armin Kuster <akuster808 at gmail.com>
-
-Index: src/tpm_library.c
-===================================================================
---- git.orig/src/tpm_library.c
-+++ git/src/tpm_library.c
-@@ -405,8 +405,8 @@ int TPMLIB_LogPrintf(const char *format,
- }
-
- if (debug_prefix)
-- dprintf(debug_fd, debug_prefix);
-- dprintf(debug_fd, buffer);
-+ dprintf(debug_fd, "%s" , debug_prefix);
-+ dprintf(debug_fd, "%s" , buffer);
-
- return i;
- }
diff --git a/recipes-tpm/libtpm/libtpm_1.0.bb b/recipes-tpm/libtpm/libtpm_1.0.bb
index 449e8c1..f9624f6 100644
--- a/recipes-tpm/libtpm/libtpm_1.0.bb
+++ b/recipes-tpm/libtpm/libtpm_1.0.bb
@@ -5,7 +5,8 @@ LIC_FILES_CHKSUM = "file://LICENSE;md5=97e5eea8d700d76b3ddfd35c4c96485f"
SRCREV = "ad44846dda5a96e269ad2f78a532e01e9a2f02a1"
SRC_URI = " \
git://github.com/stefanberger/libtpms.git \
- file://fix_dprintf_issue.patch \
+ file://Convert-another-vdprintf-to-dprintf.patch \
+ file://Use-format-s-for-call-to-dprintf.patch \
"
S = "${WORKDIR}/git"
--
2.7.4
More information about the yocto
mailing list