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)
Oct 31 2024, 9:17 PM
Unknown Object (File)
Oct 19 2024, 4:13 AM
Unknown Object (File)
Oct 1 2024, 11:20 AM
Unknown Object (File)
Oct 1 2024, 10:51 AM
Unknown Object (File)
Sep 30 2024, 3:11 PM
Unknown Object (File)
Sep 30 2024, 1:59 AM
Unknown Object (File)
Sep 26 2024, 10:07 PM
Unknown Object (File)
Sep 26 2024, 12:47 AM

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.