diff options
author | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-04 14:35:32 +0000 |
---|---|---|
committer | Bret Lambert <blambert@cvs.openbsd.org> | 2011-04-04 14:35:32 +0000 |
commit | ef065751245814b0258e03ad331fbc4bf21e14ee (patch) | |
tree | 909bba94b0753f5c29fe8ad36c178b3190ce2412 | |
parent | 2bb33c4114c4c727387cf2bc01412cce35d01bb5 (diff) |
When moving packet header data from mbuf to mbuf, re-init the list
of mbuf tags on the `from' mbuf so that we're not in danger of
double-freeing should the M_PKTHDR flag somehow sneak back to
that mbuf.
I'm almost sure that this is theoretical, but I'm erring on the
side of paranoia.
Found when chasing a panic report from phessler@
ok claudio@ henning@
-rw-r--r-- | sys/sys/mbuf.h | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sys/sys/mbuf.h b/sys/sys/mbuf.h index e9eb8629139..c6b5dd75972 100644 --- a/sys/sys/mbuf.h +++ b/sys/sys/mbuf.h @@ -1,4 +1,4 @@ -/* $OpenBSD: mbuf.h,v 1.145 2011/03/24 20:09:45 bluhm Exp $ */ +/* $OpenBSD: mbuf.h,v 1.146 2011/04/04 14:35:31 blambert Exp $ */ /* $NetBSD: mbuf.h,v 1.19 1996/02/09 18:25:14 christos Exp $ */ /* @@ -284,11 +284,12 @@ struct mbuf { /* * Move just m_pkthdr from from to to, - * remove M_PKTHDR and clean the tag for from. + * remove M_PKTHDR and clean flags/tags for from. */ #define M_MOVE_HDR(to, from) do { \ (to)->m_pkthdr = (from)->m_pkthdr; \ (from)->m_flags &= ~M_PKTHDR; \ + SLIST_INIT(&(from)->m_pkthdr.tags); \ } while (/* CONSTCOND */ 0) /* |