From: VMware, Inc <> Date: Wed, 26 Jan 2011 01:37:27 +0000 (-0800) Subject: The HGFS leaks session objects when disabling Shared Folders X-Git-Tag: stable-8.8.0~17 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=e59abfd7242f3f4ffd1975d288d9def74cb282ef;p=thirdparty%2Fopen-vm-tools.git The HGFS leaks session objects when disabling Shared Folders 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 --- diff --git a/open-vm-tools/lib/hgfsServer/hgfsServer.c b/open-vm-tools/lib/hgfsServer/hgfsServer.c index c4b1dfd37..af28c2c67 100644 --- a/open-vm-tools/lib/hgfsServer/hgfsServer.c +++ b/open-vm-tools/lib/hgfsServer/hgfsServer.c @@ -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 }