]> CyberLeo.Net >> Repos - FreeBSD/stable/10.git/commit
MFC r297298:
authornp <np@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 1 Apr 2016 01:39:44 +0000 (01:39 +0000)
committernp <np@ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f>
Fri, 1 Apr 2016 01:39:44 +0000 (01:39 +0000)
commitb7517bd6a6733e2196f7581557b2bcebc4881d3f
tree04c531edc9702284c235a1dd73d73c725fa2551c
parentc68b01786c1fe875bd1b853fcd2d62408b68fb7c
MFC r297298:
Plug leak in m_unshare.

m_unshare passes on the source mbuf's flags as-is to m_getcl and this
results in a leak if the flags include M_NOFREE.  The fix is to clear
the bits not listed in M_COPYALL before calling m_getcl.  M_RDONLY
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.

Sponsored by: Chelsio Communications

git-svn-id: svn://svn.freebsd.org/base/stable/10@297478 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f
sys/dev/netmap/netmap_generic.c
sys/kern/kern_mbuf.c
sys/kern/uipc_mbuf.c