Page MenuHomeFreeBSD

Plug mbuf leak in m_unshare.
ClosedPublic

Authored by np on Mar 21 2016, 9:01 PM.
Tags
None
Referenced Files
Unknown Object (File)
Thu, May 2, 2:42 PM
Unknown Object (File)
Wed, Apr 24, 1:02 AM
Unknown Object (File)
Wed, Apr 24, 1:02 AM
Unknown Object (File)
Wed, Apr 24, 12:57 AM
Unknown Object (File)
Wed, Apr 24, 12:57 AM
Unknown Object (File)
Wed, Apr 24, 12:51 AM
Unknown Object (File)
Dec 20 2023, 12:09 AM
Unknown Object (File)
Oct 25 2023, 4:44 PM

Details

Summary

Plug in a leak in m_unshare where it passes on M_NOFREE from the source
mbuf's flags to m_getcl. The mbuf allocated by m_getcl is never freed
as a result. M_READONLY should probably be filtered out too but that's
outside the scope of this fix.

Add assertions in the zone_mbuf and zone_pack ctors to catch similar
bugs.

Update netmap_get_mbuf to not pass M_NOFREE to m_getcl. It's not clear
what the original code was trying to do but it's likely incorrect.
Updated code is no different functionally but it avoids the newly added
assertions.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

np retitled this revision from to Plug mbuf leak in m_unshare..
np updated this object.
np edited the test plan for this revision. (Show Details)
np added reviewers: gnn, glebius.
np added a subscriber: network.
gnn edited edge metadata.
This revision is now accepted and ready to land.Mar 22 2016, 12:08 AM

Anyone else want to review this? I'll wait a couple of days and then commit to head.

Your assumption that M_RDONLY should be also filtered seems correct.

This revision was automatically updated to reflect the committed changes.