Date: Sat, 11 Oct 2014 22:08:53 +0000 (UTC) From: Adrian Chadd <adrian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-stable@freebsd.org, svn-src-stable-10@freebsd.org Subject: svn commit: r272965 - stable/10/sys/dev/ixgbe Message-ID: <201410112208.s9BM8rlC017319@svn.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: adrian Date: Sat Oct 11 22:08:53 2014 New Revision: 272965 URL: https://svnweb.freebsd.org/changeset/base/272965 Log: Merge r271647 - Fix a double-free of mbufs in rx_ixgbe_discard(). fmp->buf at the free point is already part of the chain being freed, so double-freeing is counter-productive. Submitted by: Marc De La Gueronniere <mdelagueronniere@verisign.com> Sponsored by: Verisign, Inc. Modified: stable/10/sys/dev/ixgbe/ixgbe.c Directory Properties: stable/10/ (props changed) Modified: stable/10/sys/dev/ixgbe/ixgbe.c ============================================================================== --- stable/10/sys/dev/ixgbe/ixgbe.c Sat Oct 11 21:54:23 2014 (r272964) +++ stable/10/sys/dev/ixgbe/ixgbe.c Sat Oct 11 22:08:53 2014 (r272965) @@ -4368,11 +4368,6 @@ ixgbe_rx_discard(struct rx_ring *rxr, in rbuf = &rxr->rx_buffers[i]; - if (rbuf->fmp != NULL) {/* Partial chain ? */ - rbuf->fmp->m_flags |= M_PKTHDR; - m_freem(rbuf->fmp); - rbuf->fmp = NULL; - } /* ** With advanced descriptors the writeback @@ -4381,7 +4376,13 @@ ixgbe_rx_discard(struct rx_ring *rxr, in ** the normal refresh path to get new buffers ** and mapping. */ - if (rbuf->buf) { + + if (rbuf->fmp != NULL) {/* Partial chain ? */ + rbuf->fmp->m_flags |= M_PKTHDR; + m_freem(rbuf->fmp); + rbuf->fmp = NULL; + rbuf->buf = NULL; /* rbuf->buf is part of fmp's chain */ + } else if (rbuf->buf) { m_free(rbuf->buf); rbuf->buf = NULL; }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201410112208.s9BM8rlC017319>