Page MenuHomeFreeBSD

mcast: fix memory leak in imf_purge()
ClosedPublic

Authored by kp on Aug 29 2023, 9:47 AM.
Tags
None
Referenced Files
F103037121: D41629.diff
Wed, Nov 20, 3:03 AM
Unknown Object (File)
Sat, Nov 2, 6:42 AM
Unknown Object (File)
Fri, Oct 25, 8:06 PM
Unknown Object (File)
Oct 3 2024, 12:23 AM
Unknown Object (File)
Oct 1 2024, 1:42 PM
Unknown Object (File)
Sep 27 2024, 3:02 PM
Unknown Object (File)
Sep 23 2024, 6:13 PM
Unknown Object (File)
Sep 23 2024, 5:59 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 Skipped
Unit
Tests Skipped
Build Status
Buildable 53328
Build 50219: arc lint + arc unit

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.