summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authoritojun <itojun@openbsd.org>2003-05-03 01:43:07 +0000
committeritojun <itojun@openbsd.org>2003-05-03 01:43:07 +0000
commitff001ed2778757019e9c93f6b0b9a7d4cf618674 (patch)
tree9d5b940e65da0d46cbcac58e2cf73daf32cad3ea
parentimplement and enable a mmaping pages test (mmap over .data etc, (diff)
downloadwireguard-openbsd-ff001ed2778757019e9c93f6b0b9a7d4cf618674.tar.xz
wireguard-openbsd-ff001ed2778757019e9c93f6b0b9a7d4cf618674.zip
just as a safety measure, set m_flags to 0 for mbufs allocated on stack.
dhartmei ok
-rw-r--r--sys/net/if_faith.c3
-rw-r--r--sys/net/if_gif.c3
-rw-r--r--sys/net/if_loop.c3
-rw-r--r--sys/net/if_vlan.c4
-rw-r--r--sys/netinet/ip_ah.c3
-rw-r--r--sys/netinet/ip_esp.c3
-rw-r--r--sys/netinet/ip_ether.c3
-rw-r--r--sys/netinet/ip_gre.c4
-rw-r--r--sys/netinet/ip_ipip.c3
-rw-r--r--sys/netinet/ipsec_input.c3
10 files changed, 22 insertions, 10 deletions
diff --git a/sys/net/if_faith.c b/sys/net/if_faith.c
index f9096d9a3a6..45d6d7a5192 100644
--- a/sys/net/if_faith.c
+++ b/sys/net/if_faith.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_faith.c,v 1.12 2002/06/30 13:04:36 itojun Exp $ */
+/* $OpenBSD: if_faith.c,v 1.13 2003/05/03 01:43:07 itojun Exp $ */
/*
* Copyright (c) 1982, 1986, 1993
* The Regents of the University of California. All rights reserved.
@@ -141,6 +141,7 @@ faithoutput(ifp, m, dst, rt)
struct mbuf m0;
u_int32_t af = dst->sa_family;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *)&af;
diff --git a/sys/net/if_gif.c b/sys/net/if_gif.c
index 1ffbeb66212..d7bc71ed518 100644
--- a/sys/net/if_gif.c
+++ b/sys/net/if_gif.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_gif.c,v 1.26 2003/01/20 01:34:26 itojun Exp $ */
+/* $OpenBSD: if_gif.c,v 1.27 2003/05/03 01:43:07 itojun Exp $ */
/* $KAME: if_gif.c,v 1.43 2001/02/20 08:51:07 itojun Exp $ */
/*
@@ -199,6 +199,7 @@ gif_output(ifp, m, dst, rt)
struct mbuf m0;
u_int32_t af = dst->sa_family;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *)&af;
diff --git a/sys/net/if_loop.c b/sys/net/if_loop.c
index e9007158fd5..76a971badb6 100644
--- a/sys/net/if_loop.c
+++ b/sys/net/if_loop.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_loop.c,v 1.26 2003/01/07 09:00:33 kjc Exp $ */
+/* $OpenBSD: if_loop.c,v 1.27 2003/05/03 01:43:07 itojun Exp $ */
/* $NetBSD: if_loop.c,v 1.15 1996/05/07 02:40:33 thorpej Exp $ */
/*
@@ -241,6 +241,7 @@ looutput(ifp, m, dst, rt)
struct mbuf m0;
u_int32_t af = htonl(dst->sa_family);
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = sizeof(af);
m0.m_data = (char *)&af;
diff --git a/sys/net/if_vlan.c b/sys/net/if_vlan.c
index 4ff6f3b3613..22ee8975afe 100644
--- a/sys/net/if_vlan.c
+++ b/sys/net/if_vlan.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: if_vlan.c,v 1.35 2003/03/24 17:59:48 jason Exp $ */
+/* $OpenBSD: if_vlan.c,v 1.36 2003/05/03 01:43:07 itojun Exp $ */
/*
* Copyright 1998 Massachusetts Institute of Technology
*
@@ -351,6 +351,8 @@ vlan_input(eh, m)
* that yet.
*/
struct mbuf m0;
+
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = sizeof(struct ether_header);
m0.m_data = (char *)eh;
diff --git a/sys/netinet/ip_ah.c b/sys/netinet/ip_ah.c
index 09df206fc98..780071a5554 100644
--- a/sys/netinet/ip_ah.c
+++ b/sys/netinet/ip_ah.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ah.c,v 1.74 2003/04/02 20:09:26 millert Exp $ */
+/* $OpenBSD: ip_ah.c,v 1.75 2003/05/03 01:43:07 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -946,6 +946,7 @@ ah_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
hdr.spi = tdb->tdb_spi;
hdr.flags |= M_AUTH | M_AUTH_AH;
+ m1.m_flags = 0;
m1.m_next = m;
m1.m_len = ENC_HDRLEN;
m1.m_data = (char *) &hdr;
diff --git a/sys/netinet/ip_esp.c b/sys/netinet/ip_esp.c
index 828cec43360..1b45d8a8de4 100644
--- a/sys/netinet/ip_esp.c
+++ b/sys/netinet/ip_esp.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_esp.c,v 1.82 2003/04/02 20:09:26 millert Exp $ */
+/* $OpenBSD: ip_esp.c,v 1.83 2003/05/03 01:43:07 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -711,6 +711,7 @@ esp_output(struct mbuf *m, struct tdb *tdb, struct mbuf **mp, int skip,
if (esph)
hdr.flags |= M_AUTH;
+ m1.m_flags = 0;
m1.m_next = m;
m1.m_len = ENC_HDRLEN;
m1.m_data = (char *) &hdr;
diff --git a/sys/netinet/ip_ether.c b/sys/netinet/ip_ether.c
index 713696fdd87..00371a5bc63 100644
--- a/sys/netinet/ip_ether.c
+++ b/sys/netinet/ip_ether.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ether.c,v 1.43 2003/03/06 11:54:06 markus Exp $ */
+/* $OpenBSD: ip_ether.c,v 1.44 2003/05/03 01:43:07 itojun Exp $ */
/*
* The author of this code is Angelos D. Keromytis (kermit@adk.gr)
*
@@ -246,6 +246,7 @@ etherip_input(struct mbuf *m, ...)
struct mbuf m0;
u_int32_t af = sdst.sa.sa_family;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *)&af;
diff --git a/sys/netinet/ip_gre.c b/sys/netinet/ip_gre.c
index 38cedbc0e62..b80f99047ef 100644
--- a/sys/netinet/ip_gre.c
+++ b/sys/netinet/ip_gre.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_gre.c,v 1.20 2003/04/22 02:52:28 itojun Exp $ */
+/* $OpenBSD: ip_gre.c,v 1.21 2003/05/03 01:43:07 itojun Exp $ */
/* $NetBSD: ip_gre.c,v 1.9 1999/10/25 19:18:11 drochner Exp $ */
/*
@@ -214,6 +214,7 @@ gre_input2(m , hlen, proto)
*/
struct mbuf m0;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *) &af;
@@ -361,6 +362,7 @@ gre_mobile_input(struct mbuf *m, ...)
struct mbuf m0;
u_int af = AF_INET;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *) &af;
diff --git a/sys/netinet/ip_ipip.c b/sys/netinet/ip_ipip.c
index 41ddce52389..7ede8ae4bd6 100644
--- a/sys/netinet/ip_ipip.c
+++ b/sys/netinet/ip_ipip.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ip_ipip.c,v 1.28 2003/01/31 17:27:03 deraadt Exp $ */
+/* $OpenBSD: ip_ipip.c,v 1.29 2003/05/03 01:43:07 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -369,6 +369,7 @@ ipip_input(struct mbuf *m, int iphlen, struct ifnet *gifp)
else
af = AF_INET6;
+ m0.m_flags = 0;
m0.m_next = m;
m0.m_len = 4;
m0.m_data = (char *)&af;
diff --git a/sys/netinet/ipsec_input.c b/sys/netinet/ipsec_input.c
index 53b547d857b..644548846ae 100644
--- a/sys/netinet/ipsec_input.c
+++ b/sys/netinet/ipsec_input.c
@@ -1,4 +1,4 @@
-/* $OpenBSD: ipsec_input.c,v 1.63 2003/02/20 18:35:43 deraadt Exp $ */
+/* $OpenBSD: ipsec_input.c,v 1.64 2003/05/03 01:43:07 itojun Exp $ */
/*
* The authors of this code are John Ioannidis (ji@tla.org),
* Angelos D. Keromytis (kermit@csd.uch.gr) and
@@ -538,6 +538,7 @@ ipsec_common_input_cb(struct mbuf *m, struct tdb *tdbp, int skip, int protoff,
hdr.spi = tdbp->tdb_spi;
hdr.flags = m->m_flags & (M_AUTH|M_CONF|M_AUTH_AH);
+ m1.m_flags = 0;
m1.m_next = m;
m1.m_len = ENC_HDRLEN;
m1.m_data = (char *) &hdr;