diff options
| author | 2017-06-27 12:02:43 +0000 | |
|---|---|---|
| committer | 2017-06-27 12:02:43 +0000 | |
| commit | 2f18f0241708f39e790db0193c6527f977a05a4e (patch) | |
| tree | 4e9dc0341efc37006abaaf3099c764d496036fcf /sys/nfs/nfs_socket.c | |
| parent | remove -DSw; the useful parts are now covered by mandoc; (diff) | |
| download | wireguard-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.c | 4 |
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; |
