diff options
author | rwatson <rwatson@FreeBSD.org> | 2005-06-01 11:38:19 +0000 |
---|---|---|
committer | rwatson <rwatson@FreeBSD.org> | 2005-06-01 11:38:19 +0000 |
commit | d32144e2d4c85bd11363896bb0fad645d52f0294 (patch) | |
tree | fcf9bb51ae4a2ed2dcd3647f0533baecfa599387 /sys/netinet6/udp6_usrreq.c | |
parent | 54f37e8648c9633304fffa13845131ce5cce55e2 (diff) | |
download | FreeBSD-src-d32144e2d4c85bd11363896bb0fad645d52f0294.zip FreeBSD-src-d32144e2d4c85bd11363896bb0fad645d52f0294.tar.gz |
Lock udbinfo and inp before calling in6_pcbdetach() from udp6_abort().
MFC after: 1 week
Diffstat (limited to 'sys/netinet6/udp6_usrreq.c')
-rw-r--r-- | sys/netinet6/udp6_usrreq.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/netinet6/udp6_usrreq.c b/sys/netinet6/udp6_usrreq.c index 0e523c5..9c6517d 100644 --- a/sys/netinet6/udp6_usrreq.c +++ b/sys/netinet6/udp6_usrreq.c @@ -498,12 +498,17 @@ udp6_abort(struct socket *so) struct inpcb *inp; int s; + INP_INFO_WLOCK(&udbinfo); inp = sotoinpcb(so); - if (inp == 0) + if (inp == 0) { + INP_INFO_WUNLOCK(&udbinfo); return EINVAL; /* ??? possible? panic instead? */ + } soisdisconnected(so); s = splnet(); + INP_LOCK(inp); in6_pcbdetach(inp); + INP_INFO_WUNLOCK(&udbinfo); splx(s); return 0; } |