summaryrefslogtreecommitdiff
path: root/sys/kern
diff options
context:
space:
mode:
authorClaudio Jeker <claudio@cvs.openbsd.org>2020-04-11 14:07:07 +0000
committerClaudio Jeker <claudio@cvs.openbsd.org>2020-04-11 14:07:07 +0000
commit2155d6e5608539cf16ef19449b35a9958c417f65 (patch)
treeae41b5577eec242c7106bd59abe52f35df50849d /sys/kern
parent25e270af9d46c868c807cbf1ac8ad20c29de58b6 (diff)
Add soassertlocked() checks to sbappend() and sbappendaddr(). This brings
them in line with sbappendstream() and sbappendrecord(). Agreed by mpi@
Diffstat (limited to 'sys/kern')
-rw-r--r--sys/kern/uipc_socket2.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/sys/kern/uipc_socket2.c b/sys/kern/uipc_socket2.c
index f1ef9593c4c..bb0caf90af2 100644
--- a/sys/kern/uipc_socket2.c
+++ b/sys/kern/uipc_socket2.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: uipc_socket2.c,v 1.103 2020/02/14 14:32:44 mpi Exp $ */
+/* $OpenBSD: uipc_socket2.c,v 1.104 2020/04/11 14:07:06 claudio Exp $ */
/* $NetBSD: uipc_socket2.c,v 1.11 1996/02/04 02:17:55 christos Exp $ */
/*
@@ -619,6 +619,7 @@ sbappend(struct socket *so, struct sockbuf *sb, struct mbuf *m)
if (m == NULL)
return;
+ soassertlocked(so);
SBLASTRECORDCHK(sb, "sbappend 1");
if ((n = sb->sb_lastrecord) != NULL) {
@@ -784,6 +785,8 @@ sbappendaddr(struct socket *so, struct sockbuf *sb, const struct sockaddr *asa,
struct mbuf *m, *n, *nlast;
int space = asa->sa_len;
+ soassertlocked(so);
+
if (m0 && (m0->m_flags & M_PKTHDR) == 0)
panic("sbappendaddr");
if (m0)