diff --git a/0001-tcti-tabrmd-Fix-NULL-deref-bug-by-moving-debug-outpu.patch b/0001-tcti-tabrmd-Fix-NULL-deref-bug-by-moving-debug-outpu.patch new file mode 100644 index 0000000..d208e79 --- /dev/null +++ b/0001-tcti-tabrmd-Fix-NULL-deref-bug-by-moving-debug-outpu.patch @@ -0,0 +1,50 @@ +From 418d49669a33f9e6b029787e3869b3a534bb7de8 Mon Sep 17 00:00:00 2001 +From: Philip Tricca +Date: Mon, 14 Aug 2017 13:57:51 -0700 +Subject: [PATCH] tcti-tabrmd: Fix NULL deref bug by moving debug output after + NULL check. + +This one speaks for itself: The debug output dereferences the pointer to +the context structure before checking for NULL. Switching these two +things around fixes the issue. + +Signed-off-by: Philip Tricca +--- + src/tcti-tabrmd.c | 8 ++++---- + 1 file changed, 4 insertions(+), 4 deletions(-) + +diff --git a/src/tcti-tabrmd.c b/src/tcti-tabrmd.c +index 970702c..134cf8d 100644 +--- a/src/tcti-tabrmd.c ++++ b/src/tcti-tabrmd.c +@@ -293,11 +293,11 @@ tss2_tcti_tabrmd_cancel (TSS2_TCTI_CONTEXT *context) + GError *error = NULL; + gboolean cancel_ret; + +- g_info("tss2_tcti_tabrmd_cancel: id 0x%" PRIx64, +- TSS2_TCTI_TABRMD_ID (context)); + if (context == NULL) { + return TSS2_TCTI_RC_BAD_CONTEXT; + } ++ g_info("tss2_tcti_tabrmd_cancel: id 0x%" PRIx64, ++ TSS2_TCTI_TABRMD_ID (context)); + if (TSS2_TCTI_TABRMD_STATE (context) != TABRMD_STATE_RECEIVE) { + return TSS2_TCTI_RC_BAD_SEQUENCE; + } +@@ -346,11 +346,11 @@ tss2_tcti_tabrmd_set_locality (TSS2_TCTI_CONTEXT *context, + TSS2_RC ret = TSS2_RC_SUCCESS; + GError *error = NULL; + +- g_info ("tss2_tcti_tabrmd_set_locality: id 0x%" PRIx64, +- TSS2_TCTI_TABRMD_ID (context)); + if (context == NULL) { + return TSS2_TCTI_RC_BAD_CONTEXT; + } ++ g_info ("tss2_tcti_tabrmd_set_locality: id 0x%" PRIx64, ++ TSS2_TCTI_TABRMD_ID (context)); + if (TSS2_TCTI_TABRMD_STATE (context) != TABRMD_STATE_TRANSMIT) { + return TSS2_TCTI_RC_BAD_SEQUENCE; + } +-- +2.13.6 + diff --git a/tpm2-abrmd.spec b/tpm2-abrmd.spec index fe7f35a..775fb9c 100644 --- a/tpm2-abrmd.spec +++ b/tpm2-abrmd.spec @@ -1,11 +1,13 @@ Name: tpm2-abrmd Version: 1.1.0 -Release: 6%{?dist} +Release: 7%{?dist} Summary: A system daemon implementing TPM2 Access Broker and Resource Manager License: BSD URL: https://github.com/01org/tpm2-abrmd Source0: https://github.com/01org/tpm2-abrmd/archive/%{version}/%{name}-%{version}.tar.gz +# upstream commit 418d49669a33f9e6b029787e3869b3a534bb7de8 +Patch0: 0001-tcti-tabrmd-Fix-NULL-deref-bug-by-moving-debug-outpu.patch %{?systemd_requires} BuildRequires: systemd @@ -30,7 +32,7 @@ tpm2-abrmd is a system daemon implementing the TPM2 access broker (TAB) and Resource Manager (RM) spec from the TCG. %prep -%autosetup -n %{name}-%{version} +%autosetup -p1 -n %{name}-%{version} autoreconf -vif %build @@ -91,6 +93,9 @@ required to build applications that use tpm2-abrmd. %systemd_postun tpm2-abrmd.service %changelog +* Wed Oct 18 2017 Jerry Snitselaar - 1.1.0-7 +- tcti-abrmd: Fix null deref + * Fri Oct 13 2017 Sun Yunying - 1.1.0-6 - Add tss user if doesn't currently exist - PR#1 from Jerry Snitselaar - Removed source tarball and cleared it from .gitignore