Source-Changes-HG archive

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

[src/netbsd-7]: src/sys/dev/pci Pull up following revision(s) (requested by m...



details:   https://anonhg.NetBSD.org/src/rev/b0732faaa339
branches:  netbsd-7
changeset: 799327:b0732faaa339
user:      snj <snj%NetBSD.org@localhost>
date:      Fri May 15 03:50:36 2015 +0000

description:
Pull up following revision(s) (requested by maxv in ticket #763):
        sys/dev/pci/hifn7751.c: revisions 1.58, 1.61
fix mbuf leak on failure (Brainy)
--
Use-after-free. Found by Brainy.

diffstat:

 sys/dev/pci/hifn7751.c |  11 +++++++----
 1 files changed, 7 insertions(+), 4 deletions(-)

diffs (39 lines):

diff -r af227e40cbaa -r b0732faaa339 sys/dev/pci/hifn7751.c
--- a/sys/dev/pci/hifn7751.c    Fri May 15 03:44:17 2015 +0000
+++ b/sys/dev/pci/hifn7751.c    Fri May 15 03:50:36 2015 +0000
@@ -1,4 +1,4 @@
-/*     $NetBSD: hifn7751.c,v 1.56.2.2 2015/05/11 06:15:46 msaitoh Exp $        */
+/*     $NetBSD: hifn7751.c,v 1.56.2.3 2015/05/15 03:50:36 snj Exp $    */
 /*     $FreeBSD: hifn7751.c,v 1.5.2.7 2003/10/08 23:52:00 sam Exp $ */
 /*     $OpenBSD: hifn7751.c,v 1.140 2003/08/01 17:55:54 deraadt Exp $  */
 
@@ -48,7 +48,7 @@
  */
 
 #include <sys/cdefs.h>
-__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.56.2.2 2015/05/11 06:15:46 msaitoh Exp $");
+__KERNEL_RCSID(0, "$NetBSD: hifn7751.c,v 1.56.2.3 2015/05/15 03:50:36 snj Exp $");
 
 #include <sys/param.h>
 #include <sys/systm.h>
@@ -3105,8 +3105,10 @@
        if (len == MHLEN)
                M_DUP_PKTHDR(m0, mtemplate);
        MCLGET(m0, M_DONTWAIT);
-       if (!(m0->m_flags & M_EXT))
-               m_freem(m0);
+       if (!(m0->m_flags & M_EXT)) {
+               m_freem(m0);
+               return (NULL);
+       }
        len = MCLBYTES;
 
        totlen -= len;
@@ -3121,6 +3123,7 @@
                }
                MCLGET(m, M_DONTWAIT);
                if (!(m->m_flags & M_EXT)) {
+                       m_freem(m);
                        m_freem(m0);
                        return (NULL);
                }



Home | Main Index | Thread Index | Old Index