Under -fbounds-safety mtod() and mtodo() return a pointer bounded by the
mbuf's storage, and mtod_len() narrows that to m_len. Without the flag
nothing changes. debug.bounds_mtod_test checks which reads trap.
Sponsored by: The FreeBSD Foundation
Differential D60829
mbuf: add bounds-checked mtod() accessors under bounds-safety Authored by abhijeetsharma2002_gmail.com on Oct 18 2026, 1:41 AM.
Details Under -fbounds-safety mtod() and mtodo() return a pointer bounded by the Sponsored by: The FreeBSD Foundation
Diff Detail
Event Timeline
Comment Actions The bounded version of mtod() is what is right now being discussed in the network/transport group. Require review from more people so that we introduce a nice solid KPI for many years to use. Comment Actions The discussion is quite distributed :) Probably the transports bi-weekly call would be the best one to join for you. Happens at https://meet.freebsd.org/group/public/FreeBSDTCPCall/ on every second Thursday. If you email me with your email that is associated with a Google ID I can send you invite via Google Calendar. | ||||||||||||||||||||||||||