svcrpc: modifying valid sunrpc cache entries is racy
authorJ. Bruce Fields <bfields@redhat.com>
Fri, 24 Dec 2010 19:03:38 +0000 (14:03 -0500)
committerJ. Bruce Fields <bfields@redhat.com>
Tue, 4 Jan 2011 21:47:29 +0000 (16:47 -0500)
commit31f7aa65f536995c6d933c57230919ae408952a5
tree61b9620af68d846b70a1b256d29c2a0b91febef0
parent22b6dee842c6341b49bc09cc5728eb2f8f2b3766
svcrpc: modifying valid sunrpc cache entries is racy

Once a sunrpc cache entry is VALID, we should be replacing it (and
allowing any concurrent users to destroy it on last put) instead of
trying to update it in place.

Otherwise someone referencing the ip_map we're modifying here could try
to use the m_client just as we're putting the last reference.

The bug should only be seen by users of the legacy nfsd interfaces.

(Thanks to Neil for suggestion to use sunrpc_invalidate.)

Reviewed-by: NeilBrown <neilb@suse.de>
Signed-off-by: J. Bruce Fields <bfields@redhat.com>
net/sunrpc/svcauth_unix.c