m_cat(9) will copy mbufs from the beginning of the second chain into the
last mbuf in the first chain if space is available. In this case, mbufs
from the beginning of the second chain are freed. However, the mbuf man
page claims that the second mbuf chain is always valid on return from
m_cat(9), and there are several use-after-frees that result from this
false assumption.
This is most noticeable in ieee80211_defrag() when INVARIANTS is on: the
mbuf zone destructor overwrites the second chain's pktheader with
0xdeadc0de, resulting in a bogus length that gets added into a valid
mbuf header.
This change fixes the examples of this issue that I can find, documents
m_catpkt, and fixes the m_cat documentation. The code changes would be
committed individually.