linux/net/sunrpc/auth_gss
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.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
gss_generic_token.c [NET] SUNRPC: Fix whitespace errors. 2007-02-10 23:20:13 -08:00
gss_krb5_crypto.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
gss_krb5_mech.c SUNRPC: fix print format for tk_pid in auth_gss support 2007-02-03 15:35:09 -08:00
gss_krb5_seal.c SUNRPC: fix print format for tk_pid in auth_gss support 2007-02-03 15:35:09 -08:00
gss_krb5_seqnum.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
gss_krb5_unseal.c SUNRPC: fix print format for tk_pid in auth_gss support 2007-02-03 15:35:09 -08:00
gss_krb5_wrap.c SUNRPC: fix print format for tk_pid in auth_gss support 2007-02-03 15:35:09 -08:00
gss_mech_switch.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
gss_spkm3_mech.c SUNRPC: fix print format for tk_pid in auth_gss support 2007-02-03 15:35:09 -08:00
gss_spkm3_seal.c spkm3: initialize hash 2007-05-02 07:37:07 -07:00
gss_spkm3_token.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
gss_spkm3_unseal.c Merge branch 'master' of /home/trondmy/kernel/linux-2.6/ 2007-02-12 22:43:25 -08:00
Makefile RPCSEC_GSS: Add support for privacy to krb5 rpcsec_gss mechanism. 2005-10-18 23:19:46 -07:00
svcauth_gss.c knfsd: fix resource leak resulting in module refcount leak for rpcsec_gss_krb5.ko 2007-05-09 12:30:54 -07:00