]> git.karo-electronics.de Git - linux-beck.git/commit
sunrpc: svc_sock_names should hold ref to socket being closed.
authorNeilBrown <neilb@suse.de>
Mon, 15 Nov 2010 00:27:01 +0000 (11:27 +1100)
committerJ. Bruce Fields <bfields@redhat.com>
Fri, 17 Dec 2010 20:48:19 +0000 (15:48 -0500)
commit3942302ea9e1dffa933021b20bf1642046e7641b
treec6b878198ab33ee5893f24b7366b9c209d71a2dc
parent7c96aef75949a56ec427fc6a2522dace2af33605
sunrpc: svc_sock_names should hold ref to socket being closed.

Currently svc_sock_names calls svc_close_xprt on a svc_sock to
which it does not own a reference.
As soon as svc_close_xprt sets XPT_CLOSE, the socket could be
freed by a separate thread (though this is a very unlikely race).

It is safer to hold a reference while calling svc_close_xprt.

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