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

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