]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
VMCI: reset datagram buffer pointer on dealloc
authorOliver Kurth <okurth@vmware.com>
Wed, 7 Jun 2017 00:17:04 +0000 (17:17 -0700)
committerOliver Kurth <okurth@vmware.com>
Wed, 7 Jun 2017 00:17:04 +0000 (17:17 -0700)
Fix a potential guest crash when unloading the VMCI
driver while upgrading to a specific version of UEK.
A BH may run during module unload and attempt to deliver
datagrams to the datagram buffer after it has been
deallocated. It turns out that the tasklet may not
yet have been scheduled, so add a tasklet_disable to
guard against that.  Also, reset the datagram buffer
pointer when the buffer is deallocated to indicate
that it is no longer there.

open-vm-tools/modules/linux/vmci/linux/driver.c
open-vm-tools/modules/linux/vmci/linux/vmci_version.h

index 77636a03295245ceb705bdb1d1767870466dc3ee..579e008b7fd9c65266d449bf06db0630363a2a8a 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2011-2014 VMware, Inc. All rights reserved.
+ * Copyright (C) 2011-2014,2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -2015,6 +2015,8 @@ vmci_remove_device(struct pci_dev* pdev)
    dev->exclusive_vectors = FALSE;
    dev->intr_type = VMCI_INTR_TYPE_INTX;
 
+   tasklet_disable(&vmci_dg_tasklet);
+   tasklet_disable(&vmci_bm_tasklet);
    tasklet_kill(&vmci_dg_tasklet);
    tasklet_kill(&vmci_bm_tasklet);
 
@@ -2476,6 +2478,7 @@ vmci_exit(void)
    if (guestDeviceInit) {
       pci_unregister_driver(&vmci_driver);
       vfree(data_buffer);
+      data_buffer = NULL;
       guestDeviceInit = FALSE;
    }
 
index aecf0b6d6c09ae724f9406a2007041324dec1e96..b472a66b2d55edd3f89534ca3e1789c0b98e29c6 100644 (file)
@@ -1,5 +1,5 @@
 /*********************************************************
- * Copyright (C) 2007-2014 VMware, Inc. All rights reserved.
+ * Copyright (C) 2007-2014,2017 VMware, Inc. All rights reserved.
  *
  * This program is free software; you can redistribute it and/or modify it
  * under the terms of the GNU General Public License as published by the
@@ -25,8 +25,8 @@
 #ifndef _VMCI_VERSION_H_
 #define _VMCI_VERSION_H_
 
-#define VMCI_DRIVER_VERSION          9.8.1.0
-#define VMCI_DRIVER_VERSION_COMMAS   9,8,1,0
-#define VMCI_DRIVER_VERSION_STRING   "9.8.1.0"
+#define VMCI_DRIVER_VERSION          9.8.2.0
+#define VMCI_DRIVER_VERSION_COMMAS   9,8,2,0
+#define VMCI_DRIVER_VERSION_STRING   "9.8.2.0"
 
 #endif /* _VMCI_VERSION_H_ */