Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 26 Mar 2015 23:10:49 +0300
From:      "Andrey V. Elsukov" <bu7cher@yandex.ru>
To:        Alexandre Martins <alexandre.martins@stormshield.eu>,  freebsd-current@freebsd.org
Subject:   Re: Mbuf leak in if_lagg.c
Message-ID:  <551467C9.3000103@yandex.ru>
In-Reply-To: <55146124.2070501@yandex.ru>
References:  <1708955.mQ2X6OUmTD@pc-alex> <55146124.2070501@yandex.ru>

next in thread | previous in thread | raw e-mail | index | archive | help
This is an OpenPGP/MIME signed message (RFC 4880 and 3156)
--CeMp2gjn6qptS0PahBrTD449kw4W6sLov
Content-Type: multipart/mixed;
 boundary="------------020207000908040202050902"

This is a multi-part message in MIME format.
--------------020207000908040202050902
Content-Type: text/plain; charset=windows-1252
Content-Transfer-Encoding: quoted-printable

On 26.03.2015 22:42, Andrey V. Elsukov wrote:
>> If lp_detaching is non 0, the mbuf pointer is set to NULL without m_fr=
eem it.
>>
>> Can you look at this ?
>=20
> Hi,
>=20
> what you thing about this patch?
> lp_detaching can be non zero in case of parent interface departure.
> So I don't see the reason to call ETHER_BPF_MTAP() in this case.

Now I see the reason - to capture all received packets before interface
departure. New is attached.

--=20
WBR, Andrey V. Elsukov

--------------020207000908040202050902
Content-Type: text/x-patch;
 name="if_lagg.diff"
Content-Transfer-Encoding: quoted-printable
Content-Disposition: attachment;
 filename="if_lagg.diff"

Index: if_lagg.c
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=
=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D=3D
--- if_lagg.c	(revision 280234)
+++ if_lagg.c	(working copy)
@@ -1669,7 +1669,11 @@ lagg_input(struct ifnet *ifp, struct mbuf *m)
=20
 	ETHER_BPF_MTAP(scifp, m);
=20
-	m =3D (lp->lp_detaching =3D=3D 0) ? lagg_proto_input(sc, lp, m) : NULL;=

+	if (lp->lp_detaching !=3D 0) {
+		m_freem(m);
+		m =3D NULL;
+	} else
+		m =3D lagg_proto_input(sc, lp, m);
=20
 	if (m !=3D NULL) {
 		if (scifp->if_flags & IFF_MONITOR) {

--------------020207000908040202050902--

--CeMp2gjn6qptS0PahBrTD449kw4W6sLov
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: OpenPGP digital signature
Content-Disposition: attachment; filename="signature.asc"

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v2
Comment: Using GnuPG with Thunderbird - http://www.enigmail.net/

iQEcBAEBCAAGBQJVFGfJAAoJEAHF6gQQyKF6sBQIAJPbquAklzNGt/UBGDprzB/u
N+pVkZE513HKj4gdeAYj1VNiWnjA9EcR1RlAPgjpm+AAXmf9uAS9JRPg24ZF8Fnw
S881jtKkDaxUcJC3cgszJsxvvwAM0Y8IMU0GL/rMHGQ3Sbmw+rof/H4lgyQyvnBJ
8617Ke+cqFNYk0krhusi2hC/mmYgfuEjmIv8bZx6ouXdobisPNNyAsdtqHPBRNLM
AioWFg1btVu1JsQ9JwuKoXDaTgoLggKaZs/nq+tyqgnKAjE/H/MKYdFn/LoH8+Jg
eMATepOJoz7Qci85H43ud+bzN9LXAkFxt6ucMfC5RVSfYRCeRVFQJre8TQiAYIg=
=NLZk
-----END PGP SIGNATURE-----

--CeMp2gjn6qptS0PahBrTD449kw4W6sLov--



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?551467C9.3000103>