Skip site navigation (1)Skip section navigation (2)
Date:      Fri, 14 May 2021 12:52:45 +0000
From:      bugzilla-noreply@freebsd.org
To:        bugs@FreeBSD.org
Subject:   [Bug 255874] [PATCH] netgraph: Fix a double free in ng_checksum_rcvdata
Message-ID:  <bug-255874-227@https.bugs.freebsd.org/bugzilla/>

next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D255874

            Bug ID: 255874
           Summary: [PATCH] netgraph: Fix a double free in
                    ng_checksum_rcvdata
           Product: Base System
           Version: CURRENT
          Hardware: Any
                OS: Any
            Status: New
          Severity: Affects Many People
          Priority: ---
         Component: kern
          Assignee: bugs@FreeBSD.org
          Reporter: lylgood@foxmail.com

Created attachment 224937
  --> https://bugs.freebsd.org/bugzilla/attachment.cgi?id=3D224937&action=
=3Dedit
removes the NG_FREE_M(m) from drop branch.

Bug File: sys/netgraph/ng_checksum.c

In function ng_checksum_rcvdata, it calls checksum_ipv4(priv, m, pullup_len)
and checksum_ipv6(priv, m, pullup_len). Inside these callees, macro
PULLUP_CHECK is called. According the definition of this macro, m could be
freed in m_pullup() and  return ENOBUFS.

Then caller ng_checksum_rcvdata accept the ENOBUFS and goto drop branch, wh=
ere
the freed m is freed again by NG_FREE_M() at line 687.

My patch removes the NG_FREE_M(m) from drop branch.

--=20
You are receiving this mail because:
You are the assignee for the bug.=



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-255874-227>