diff options
author | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-10-28 15:21:42 -0400 |
---|---|---|
committer | Trond Myklebust <Trond.Myklebust@netapp.com> | 2008-10-28 15:21:42 -0400 |
commit | 5f707eb429e2c98dfd564ffbbd9f536bf493d869 (patch) | |
tree | 5b17c3f51daa9a47959cdf320696a56c72faa70d /net/sunrpc/auth.c | |
parent | eac0d18d44705f8a1b72cccec3a453e1a43eb20a (diff) | |
download | linux-5f707eb429e2c98dfd564ffbbd9f536bf493d869.tar.gz linux-5f707eb429e2c98dfd564ffbbd9f536bf493d869.tar.bz2 linux-5f707eb429e2c98dfd564ffbbd9f536bf493d869.zip |
SUNRPC: Fix potential race in put_rpccred()
We have to be careful when we try to unhash the credential in
put_rpccred(), because we're not holding the credcache lock, so the call to
rpcauth_unhash_cred() may fail if someone else has looked the cred up, and
obtained a reference to it.
Signed-off-by: Trond Myklebust <Trond.Myklebust@netapp.com>
Diffstat (limited to 'net/sunrpc/auth.c')
-rw-r--r-- | net/sunrpc/auth.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/net/sunrpc/auth.c b/net/sunrpc/auth.c index a045a1253d49..cb216b2df666 100644 --- a/net/sunrpc/auth.c +++ b/net/sunrpc/auth.c @@ -455,7 +455,7 @@ need_lock: } if (test_bit(RPCAUTH_CRED_UPTODATE, &cred->cr_flags) == 0) rpcauth_unhash_cred(cred); - else if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { + if (test_bit(RPCAUTH_CRED_HASHED, &cred->cr_flags) != 0) { cred->cr_expire = jiffies; list_add_tail(&cred->cr_lru, &cred_unused); number_cred_unused++; |