Page MenuHomeFreeBSD

mcast: fix memory leak in imf_purge()
ClosedPublic

Authored by kp on Aug 29 2023, 9:47 AM.
Tags
None
Referenced Files
Unknown Object (File)
May 20 2024, 11:23 PM
Unknown Object (File)
May 8 2024, 11:01 PM
Unknown Object (File)
May 2 2024, 4:04 AM
Unknown Object (File)
Apr 28 2024, 5:44 PM
Unknown Object (File)
Dec 20 2023, 2:55 AM
Unknown Object (File)
Dec 12 2023, 10:10 AM
Unknown Object (File)
Nov 2 2023, 12:11 AM
Unknown Object (File)
Oct 11 2023, 2:20 PM

Details

Summary

The IGMP code buffers packets in the imf_inm->inm_scq mbufq, but does
not clear this queue when struct in_mfilter is freed by imf_purge().
This can cause memory leaks if IGMPv3 is used.

Purge the mbufq on imf_purge().

MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")

Test Plan

Running this in a loop shows a steady increate in the mbuf zone, which goes away with this fix:

epair=$(ifconfig epair create)
epair=${epair%a}

ifconfig ${epair}a up
ifconfig ${epair}b up
ifconfig ${epair}a vhid 2 advbase 2 advskew 100 pass mekmitasdigoat alias 192.168.2.1/24

sleep 1
ifconfig ${epair}a destroy

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

kp requested review of this revision.Aug 29 2023, 9:47 AM
This revision was not accepted when it landed; it landed in state Needs Review.Aug 31 2023, 10:22 AM
This revision was automatically updated to reflect the committed changes.