summaryrefslogtreecommitdiffstats
path: root/sys/netinet
diff options
context:
space:
mode:
authoranton <anton@openbsd.org>2018-07-04 02:08:13 +0000
committeranton <anton@openbsd.org>2018-07-04 02:08:13 +0000
commit07be777edd677edbb0d583a1a89fa2d191ffe3c4 (patch)
tree87682befbabc9225049a57ed893c82df5e205ac7 /sys/netinet
parentFix a wrong memcmp in k7/k8 powernow code. (diff)
downloadwireguard-openbsd-07be777edd677edbb0d583a1a89fa2d191ffe3c4.tar.xz
wireguard-openbsd-07be777edd677edbb0d583a1a89fa2d191ffe3c4.zip
Prevent a mbuf double free by not freeing it along the error-path in
rip{6,}_usrreq() since soreceive() will free it. ok bluhm@
Diffstat (limited to 'sys/netinet')
-rw-r--r--sys/netinet/raw_ip.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/sys/netinet/raw_ip.c b/sys/netinet/raw_ip.c
index 0bdbd5eb9ab..6e9ca1e197d 100644
--- a/sys/netinet/raw_ip.c
+++ b/sys/netinet/raw_ip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: raw_ip.c,v 1.109 2018/04/24 15:40:55 pirofti Exp $ */
+/* $OpenBSD: raw_ip.c,v 1.110 2018/07/04 02:08:13 anton Exp $ */
/* $NetBSD: raw_ip.c,v 1.25 1996/02/18 18:58:33 christos Exp $ */
/*
@@ -482,14 +482,16 @@ rip_usrreq(struct socket *so, int req, struct mbuf *m, struct mbuf *nam,
/*
* Not supported.
*/
- case PRU_RCVOOB:
- case PRU_RCVD:
case PRU_LISTEN:
case PRU_ACCEPT:
case PRU_SENDOOB:
error = EOPNOTSUPP;
break;
+ case PRU_RCVD:
+ case PRU_RCVOOB:
+ return (EOPNOTSUPP); /* do not free mbuf's */
+
case PRU_SOCKADDR:
in_setsockaddr(inp, nam);
break;