Source-Changes-HG archive

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index][Old Index]

[src/trunk]: src/sys/netinet6 Fix use-after-free of mbuf by ip6flow_create (o...



details:   https://anonhg.NetBSD.org/src/rev/d84443bfe050
branches:  trunk
changeset: 828887:d84443bfe050
user:      ozaki-r <ozaki-r%NetBSD.org@localhost>
date:      Tue Jan 09 04:41:19 2018 +0000

description:
Fix use-after-free of mbuf by ip6flow_create (one more)

XXX need pullup-[678]

diffstat:

 sys/netinet6/ip6_forward.c |  6 +++---
 1 files changed, 3 insertions(+), 3 deletions(-)

diffs (27 lines):

diff -r 5f45731f6d0a -r d84443bfe050 sys/netinet6/ip6_forward.c
--- a/sys/netinet6/ip6_forward.c        Tue Jan 09 04:23:59 2018 +0000
+++ b/sys/netinet6/ip6_forward.c        Tue Jan 09 04:41:19 2018 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: ip6_forward.c,v 1.89 2018/01/09 04:21:26 ozaki-r Exp $ */
+/*     $NetBSD: ip6_forward.c,v 1.90 2018/01/09 04:41:19 ozaki-r Exp $ */
 /*     $KAME: ip6_forward.c,v 1.109 2002/09/11 08:10:17 sakane Exp $   */
 
 /*
@@ -31,7 +31,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.89 2018/01/09 04:21:26 ozaki-r Exp $");
+__KERNEL_RCSID(0, "$NetBSD: ip6_forward.c,v 1.90 2018/01/09 04:41:19 ozaki-r Exp $");
 
 #ifdef _KERNEL_OPT
 #include "opt_gateway.h"
@@ -415,7 +415,7 @@
                        /* Need to release rt here */
                        rtcache_unref(rt, ro);
                        rt = NULL;
-                       if (m->m_flags & M_CANFASTFWD)
+                       if (mcopy->m_flags & M_CANFASTFWD)
                                ip6flow_create(ro, mcopy);
 #endif
                        if (mcopy)



Home | Main Index | Thread Index | Old Index