Page MenuHomeFreeBSD

mbuf: make m_unshare() allow unmapped mbufs
ClosedPublic

Authored by takahiro.kurosawa_gmail.com on Sun, Jul 12, 7:29 AM.
Tags
None
Referenced Files
F164481043: D58189.id181821.diff
Sat, Aug 1, 7:41 AM
F164455768: D58189.id181950.diff
Sat, Aug 1, 4:34 AM
F164453557: D58189.id182033.diff
Sat, Aug 1, 4:17 AM
Unknown Object (File)
Fri, Jul 31, 2:48 PM
Unknown Object (File)
Tue, Jul 28, 2:46 AM
Unknown Object (File)
Tue, Jul 21, 5:25 AM
Unknown Object (File)
Tue, Jul 21, 5:20 AM
Unknown Object (File)
Tue, Jul 21, 5:20 AM
Subscribers

Details

Summary

m_unshare() had crashed if unmapped mbufs exist in the mbuf chain.
This was because memcpy() with mtod() was used without making sure that
the mbuf was mapped. Use m_copydata() that cares unmapped mbufs instead.

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped
Build Status
Buildable 74795
Build 71678: arc lint + arc unit

Event Timeline

I'd write this as 'mcopydata(m,off, len, mtod(..));

Use m_copydata() instead of m_copyfromunmapped() as suggested by the review.

I'd write this as 'mcopydata(m,off, len, mtod(..));

I've updated the code and the summary text according to your comment.
It gets much simpler. Thanks for the review!

This revision is now accepted and ready to land.Tue, Jul 14, 5:08 PM
This revision was automatically updated to reflect the committed changes.