diff options
author | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-06-27 12:02:44 +0000 |
---|---|---|
committer | Martin Pieuchot <mpi@cvs.openbsd.org> | 2017-06-27 12:02:44 +0000 |
commit | f0a65f6c73c1cf2ffc9c459a78158d8bc7c2eebf (patch) | |
tree | dd02eb0488e429bac3bc8163c8698043cbc8f0cb /sys/kern/uipc_socket2.c | |
parent | 610462f01854762ce3b6fc1d73577cfb77e1c317 (diff) |
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/kern/uipc_socket2.c')
-rw-r--r-- | sys/kern/uipc_socket2.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c index 65c5dd74f65..9619cbd3dc4 100644 --- a/sys/kern/uipc_socket2.c +++ b/sys/kern/uipc_socket2.c @@ -1,4 +1,4 @@ -/* $OpenBSD: uipc_socket2.c,v 1.79 2017/06/26 09:32:31 mpi Exp $ */ +/* $OpenBSD: uipc_socket2.c,v 1.80 2017/06/27 12:02:43 mpi Exp $ */ /* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */ /* @@ -148,6 +148,11 @@ sonewconn(struct socket *head, int connstatus) struct socket *so; int soqueue = connstatus ? 1 : 0; + /* + * XXXSMP as long as `so' and `head' share the same lock, we + * can call soreserve() and pr_attach() below w/o expliclitly + * locking `so'. + */ soassertlocked(head); if (mclpools[0].pr_nout > mclpools[0].pr_hardlimit * 95 / 100) |