The data after a tag is m_tag_len bytes. tag + 1 has no bounds under
-fbounds-safety, so a forwarded packet would trap once tcp_input.c is
built with the flag.
Sponsored by: The FreeBSD Foundation
Differential D61778
mbuf: add m_tag_data() and use it for the fwd tag in tcp_input Authored by abhijeetsharma2002_gmail.com on Thu, Nov 19, 11:42 PM.
Details
Diff Detail
Event TimelineComment Actions I would really prefer not to introduce new KPIs for mbufs and for the mbuf tags specifically. We are looking into reducing the existing KPI and making it more strict. Specifically the tagging is supposed to be changed significantly, as current tagging is too expensive and many kernel developers just refuse to use it as long as they are able to find an extra bit in the mbuf header. Can this be achieved instead completely avoiding the pointer increment? Suggested approach: struct fwd_tag {
struct m_tag mtag;
union {
struct sockaddr_in6 sin6;
struct sockaddr_in6 sin6;
};
}If no objection, I will code something around that also documenting it as contract between the IP stack and packet filters. |