HomeFreeBSD

if_stf: KASAN fix

Description

if_stf: KASAN fix

In in_stf_input() we grabbed a pointer to the IPv4 header and later did
an m_pullup() before we look at the IPv6 header. However, m_pullup()
could rearrange the mbuf chain and potentially invalidate the pointer to
the IPv4 header.

Avoid this issue by copying the IP header rather than getting a pointer
to it.

Reported by: markj, Jenkins (KASAN job)
Reviewed by: markj
MFC after: 1 week
Sponsored by: Rubicon Communications, LLC ("Netgate")
Differential Revision: https://reviews.freebsd.org/D33192

Details

Provenance
kpAuthored on Nov 30 2021, 3:30 PM
Reviewer
markj
Differential Revision
D33192: if_stf: KASAN fix
Parents
rG0d2224733e97: Implement GET_STACK_USAGE on remaining archs
Branches
Unknown
Tags
Unknown