Bug 5541

Summary: Memory leak found on SUNRPC code on multi-threaded servers
Product: glibc Reporter: André Cruz <sourceware>
Component: libcAssignee: Ulrich Drepper <drepper.fsp>
Status: RESOLVED FIXED    
Severity: critical CC: fweimer, glibc-bugs, ian, null
Priority: P3 Flags: fweimer: security?
Version: 2.3.6   
Target Milestone: ---   
Host: Target:
Build: Last reconfirmed:
Attachments: Patch to correct bug.

Description André Cruz 2008-01-04 12:53:59 UTC
Not all structures are being freed on __rpc_thread_destroy() . This causes
memory usage to grow ad infinitum when the server is multithreaded.

Apply the following patch to fix:

--- glibc-2.3.6/sunrpc/rpc_thread.c	2003-02-22 01:57:51.000000000 +0000
+++ build-tree/glibc-2.3.6/sunrpc/rpc_thread.c	2008-01-04 12:52:06.000000000 +0000
@@ -29,6 +29,8 @@
 		free (tvp->svcraw_private_s);
 		free (tvp->authdes_cache_s);
 		free (tvp->authdes_lru_s);
+		free (tvp->svc_xports_s);
+		free (tvp->svc_pollfd_s);
 		free (tvp);
 		__libc_tsd_set (RPC_VARS, NULL);
 	}
Comment 1 André Cruz 2008-01-04 12:57:07 UTC
Created attachment 2169 [details]
Patch to correct bug.

Looks like it works.
Comment 2 Ulrich Drepper 2008-01-09 21:52:49 UTC
Applied to mainline.