summaryrefslogtreecommitdiffstats
path: root/sys/nfs/nfs_socket.c
diff options
context:
space:
mode:
authormpi <mpi@openbsd.org>2017-06-27 12:02:43 +0000
committermpi <mpi@openbsd.org>2017-06-27 12:02:43 +0000
commit2f18f0241708f39e790db0193c6527f977a05a4e (patch)
tree4e9dc0341efc37006abaaf3099c764d496036fcf /sys/nfs/nfs_socket.c
parentremove -DSw; the useful parts are now covered by mandoc; (diff)
downloadwireguard-openbsd-2f18f0241708f39e790db0193c6527f977a05a4e.tar.xz
wireguard-openbsd-2f18f0241708f39e790db0193c6527f977a05a4e.zip
Add missing solock()/sounlock() dances around sbreserve().
While here document an abuse of parent socket's lock. Problem reported by krw@, analysis and ok bluhm@
Diffstat (limited to 'sys/nfs/nfs_socket.c')
-rw-r--r--sys/nfs/nfs_socket.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/sys/nfs/nfs_socket.c b/sys/nfs/nfs_socket.c
index f12029927df..748fd82d1fc 100644
--- a/sys/nfs/nfs_socket.c
+++ b/sys/nfs/nfs_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: nfs_socket.c,v 1.118 2017/06/26 09:32:32 mpi Exp $ */
+/* $OpenBSD: nfs_socket.c,v 1.119 2017/06/27 12:02:43 mpi Exp $ */
/* $NetBSD: nfs_socket.c,v 1.27 1996/04/15 20:20:00 thorpej Exp $ */
/*
@@ -362,7 +362,9 @@ nfs_connect(struct nfsmount *nmp, struct nfsreq *rep)
rcvreserve = (nmp->nm_rsize + NFS_MAXPKTHDR +
sizeof (u_int32_t)) * 2;
}
+ s = solock(so);
error = soreserve(so, sndreserve, rcvreserve);
+ sounlock(s);
if (error)
goto bad;
so->so_rcv.sb_flags |= SB_NOINTR;