summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-15 13:00:11 +0000
committerMartin Pieuchot <mpi@cvs.openbsd.org>2017-05-15 13:00:11 +0000
commit11e3fb27edb43bf4946e1a5ba67bb0bbc8a791ce (patch)
tree6830be687c3ca6cb4b3e579fc14c0a0e215e581f
parenteb8c47fcc3b5298f706069e40d44a99c850c11de (diff)
so_splicelen needs to be protected by the socket lock. We are now
safe since we're always holding the KERNEL_LOCK() but we want to move away from that. Suggested by and ok bluhm@
-rw-r--r--sys/kern/uipc_socket.c7
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/uipc_socket.c b/sys/kern/uipc_socket.c
index edb9618ec45..29323e8a41f 100644
--- a/sys/kern/uipc_socket.c
+++ b/sys/kern/uipc_socket.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket.c,v 1.183 2017/05/15 12:26:00 mpi Exp $ */
+/* $OpenBSD: uipc_socket.c,v 1.184 2017/05/15 13:00:10 mpi Exp $ */
/* $NetBSD: uipc_socket.c,v 1.21 1996/02/04 02:17:52 christos Exp $ */
/*
@@ -1862,12 +1862,13 @@ sogetopt(struct socket *so, int level, int optname, struct mbuf **mp)
case SO_SPLICE:
{
off_t len;
- int s = splsoftnet();
+ int s;
+ s = solock(so);
m->m_len = sizeof(off_t);
len = so->so_sp ? so->so_sp->ssp_len : 0;
memcpy(mtod(m, off_t *), &len, sizeof(off_t));
- splx(s);
+ sounlock(s);
break;
}
#endif /* SOCKET_SPLICE */