linux/net/sunrpc
Frank Filz 54f9247b3f knfsd: fix resource leak resulting in module refcount leak for rpcsec_gss_krb5.ko
I have been investigating a module reference count leak on the server for
rpcsec_gss_krb5.ko.  It turns out the problem is a reference count leak for
the security context in net/sunrpc/auth_gss/svcauth_gss.c.

The problem is that gss_write_init_verf() calls gss_svc_searchbyctx() which
does a rsc_lookup() but never releases the reference to the context.  There is
another issue that rpc.svcgssd sets an "end of time" expiration for the
context

By adding a cache_put() call in gss_svc_searchbyctx(), and setting an
expiration timeout in the downcall, cache_clean() does clean up the context
and the module reference count now goes to zero after unmount.

I also verified that if the context expires and then the client makes a new
request, a new context is established.

Here is the patch to fix the kernel, I will start a separate thread to discuss
what expiration time should be set by rpc.svcgssd.

Acked-by: "J. Bruce Fields" <bfields@citi.umich.edu>
Signed-off-by: Frank Filz <ffilzlnx@us.ibm.com>
Signed-off-by: Neil Brown <neilb@suse.de>
Signed-off-by: Andrew Morton <akpm@linux-foundation.org>
Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
2007-05-09 12:30:54 -07:00
..
auth_gss knfsd: fix resource leak resulting in module refcount leak for rpcsec_gss_krb5.ko 2007-05-09 12:30:54 -07:00
auth_null.c
auth_unix.c
auth.c
cache.c
clnt.c SUNRPC: RPC client should retry with different versions of rpcbind 2007-04-30 22:17:16 -07:00
Makefile SUNRPC: remove old portmapper 2007-04-30 22:17:15 -07:00
rpc_pipe.c sunrpc: fix error path in module_init 2007-05-09 12:30:54 -07:00
rpcb_clnt.c SUNRPC: introduce rpcbind: replacement for in-kernel portmapper 2007-04-30 22:17:12 -07:00
sched.c Fix sunrpc warning noise 2007-05-08 12:03:19 -07:00
socklib.c
stats.c
sunrpc_syms.c sunrpc: fix error path in module_init 2007-05-09 12:30:54 -07:00
svc.c RPC: add wrapper for svc_reserve to account for checksum 2007-05-09 12:30:54 -07:00
svcauth_unix.c knfsd: rename sk_defer_lock to sk_lock 2007-05-09 12:30:54 -07:00
svcauth.c
svcsock.c knfsd: rename sk_defer_lock to sk_lock 2007-05-09 12:30:54 -07:00
sysctl.c
timer.c
xdr.c
xprt.c SUNRPC: introduce rpcbind: replacement for in-kernel portmapper 2007-04-30 22:17:12 -07:00
xprtsock.c SUNRPC: switch socket-based RPC transports to use rpcbind 2007-04-30 22:17:13 -07:00