Page MenuHomeFreeBSD

mbuf: make m_unshare() to fail on KTLS mbufs
ClosedPublic

Authored by takahiro.kurosawa_gmail.com on Jul 26 2026, 10:12 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Sep 14, 6:02 PM
Unknown Object (File)
Thu, Sep 10, 10:22 AM
Unknown Object (File)
Tue, Sep 8, 9:10 PM
Unknown Object (File)
Mon, Sep 7, 3:48 PM
Unknown Object (File)
Mon, Sep 7, 6:57 AM
Unknown Object (File)
Sun, Sep 6, 5:37 PM
Unknown Object (File)
Sun, Sep 6, 3:50 PM
Unknown Object (File)
Sun, Sep 6, 1:00 PM
Subscribers

Details

Summary

Commit f2202ab5abda did not take care of KTLS mbufs.
m_unshare() tries to linearize the original mbuf chain and creates
a writable copy of it with converting unmapped mbufs. Both of them are
unsafe for KTLS mbufs.
It would be better to return NULL if the mbuf chain contains a KTLS mbuf.

Reported by: jhb

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

jhb added inline comments.
sys/kern/uipc_mbuf.c
2157–2158
This revision is now accepted and ready to land.Jul 29 2026, 6:56 PM

Add a empty line to separate logical blocks.

This revision now requires review to proceed.Jul 29 2026, 11:40 PM
takahiro.kurosawa_gmail.com added inline comments.
sys/kern/uipc_mbuf.c
2157–2158

Applied, thanks!

This revision was not accepted when it landed; it landed in state Needs Review.Jul 30 2026, 12:50 PM
This revision was automatically updated to reflect the committed changes.