]> git.ipfire.org Git - thirdparty/open-vm-tools.git/commitdiff
The HGFS leaks session objects when disabling Shared Folders
authorVMware, Inc <>
Wed, 26 Jan 2011 01:37:27 +0000 (17:37 -0800)
committerMarcelo Vanzin <mvanzin@vmware.com>
Wed, 26 Jan 2011 01:37:27 +0000 (17:37 -0800)
The HGFS server session was referenced with the session create request
handler in response to a new session request call from the guest.
Unfortunately, since there is no corresponding destroy session
request from the guests so the HGFS server session will
not get destroyed due to this reference. Furthermore, there is more
work required for the handling of the disabling of Shared Folders
feature wrt to session support. This is also coming later on.

Also, once the channel is destroyed and disconnects from the
HGFS server in response to a UI disable command of the
shared folders feature, the HGFS server session is lost and
therefore leaked. Additional consequence of this is that any
open handles with that session also then remain open as they
will not be closed until the VMX process is destroyed.

Fix is to remove the session referencing from the create session and
destroy session handlers until session support is completed and
correctly handled.

Signed-off-by: Marcelo Vanzin <mvanzin@vmware.com>
open-vm-tools/lib/hgfsServer/hgfsServer.c

index c4b1dfd374faa936739e0099b773579aa7a27a70..af28c2c67acd872db1ca31f3963db08010b0b76b 100644 (file)
@@ -7253,7 +7253,14 @@ HgfsServerCreateSession(HgfsInputParam *input)  // IN: Input params
       }
       if (HgfsPackCreateSessionReply(input->packet, input->metaPacket,
                                      &replyPayloadSize, input->session)) {
+
+         /*
+          * XXX - TO BE RESTORED on session support implementation
+          * completion.
+          */
+#if defined HGFS_SESSION_SUPPORT
          HgfsServerSessionGet(input->session);
+#endif
          status = HGFS_ERROR_SUCCESS;
       } else {
          status = HGFS_ERROR_INTERNAL;
@@ -7288,7 +7295,13 @@ HgfsServerDestroySession(HgfsInputParam *input)  // IN: Input params
    HGFS_ASSERT_INPUT(input);
 
    HgfsServerCompleteRequest(HGFS_ERROR_SUCCESS, 0, input);
+   /*
+    * XXX - TO BE RESTORED on session support implementation
+    * completion.
+      */
+#if defined HGFS_SESSION_SUPPORT
    HgfsServerSessionPut(input->session);
+#endif
 }