Blame SOURCES/ovt-Fix-a-potential-NULL-pointer-dereference-in-the-vmba.patch

745ff1
From 6c6daa468c9a1ad1ad4d5bf727008d029d009a50 Mon Sep 17 00:00:00 2001
745ff1
From: Cathy Avery <cavery@redhat.com>
745ff1
Date: Tue, 3 Dec 2019 14:30:48 +0100
745ff1
Subject: [PATCH 2/4] Fix a potential NULL pointer dereference in the vmbackup
745ff1
 plugin.
745ff1
745ff1
RH-Author: Cathy Avery <cavery@redhat.com>
745ff1
Message-id: <20191203143050.23065-3-cavery@redhat.com>
745ff1
Patchwork-id: 92836
745ff1
O-Subject: [RHEL8.2 open-vm-tools PATCH 2/4] Fix a potential NULL pointer dereference in the vmbackup plugin.
745ff1
Bugzilla: 1769881
745ff1
RH-Acked-by: Vitaly Kuznetsov <vkuznets@redhat.com>
745ff1
RH-Acked-by: Miroslav Rezanina <mrezanin@redhat.com>
745ff1
745ff1
commit 0bb6cf83fb6b1f80c99beb11cd47e0db02e252ff
745ff1
Author: Oliver Kurth <okurth@vmware.com>
745ff1
Date:   Fri Nov 22 14:52:35 2019 -0800
745ff1
745ff1
    Fix a potential NULL pointer dereference in the vmbackup plugin.
745ff1
745ff1
    In some circumtances, VmBackupAsyncCallback might dereference
745ff1
    gBackupState after calling VmBackupDoAbort even though the
745ff1
    latter function can potentially set gBackupState to NULL.  Add
745ff1
    a check to prevent the potential NULL pointer dereference.
745ff1
745ff1
Signed-off-by: Cathy Avery <cavery@redhat.com>
745ff1
Signed-off-by: Miroslav Rezanina <mrezanin@redhat.com>
745ff1
---
745ff1
 open-vm-tools/services/plugins/vmbackup/stateMachine.c | 9 +++++++++
745ff1
 1 file changed, 9 insertions(+)
745ff1
745ff1
diff --git a/open-vm-tools/services/plugins/vmbackup/stateMachine.c b/open-vm-tools/services/plugins/vmbackup/stateMachine.c
745ff1
index 6b42286..5c01a7b 100644
745ff1
--- a/open-vm-tools/services/plugins/vmbackup/stateMachine.c
745ff1
+++ b/open-vm-tools/services/plugins/vmbackup/stateMachine.c
745ff1
@@ -675,6 +675,15 @@ VmBackupAsyncCallback(void *clientData)
745ff1
       if (gBackupState->rpcState == VMBACKUP_RPC_STATE_ERROR) {
745ff1
          g_warning("Aborting backup operation due to RPC errors.");
745ff1
          VmBackupDoAbort();
745ff1
+
745ff1
+         /*
745ff1
+          * Check gBackupState, since the abort could cause a transition to
745ff1
+          * VMBACKUP_MSTATE_IDLE, in which case the VmBackupState structure
745ff1
+          * would be freed and gBackupState would be NULL.
745ff1
+          */
745ff1
+         if (gBackupState == NULL) {
745ff1
+            return FALSE;
745ff1
+         }
745ff1
          goto exit;
745ff1
       }
745ff1
    }
745ff1
-- 
745ff1
1.8.3.1
745ff1