HomeFreeBSD

pf: clean up mbuf passing for reassembly

Description

pf: clean up mbuf passing for reassembly

When we call pf_normalize_ip() or pf_normalize_ip6() we passed the mbuf twice.
Once as m0, and once inside the struct pf_pdesc. Remove the former to avoid
confusion when we free *m0, but don't update pd->m.

This could lead to use-after-free errors e.g. if reassembly failed.

PR: 283705
Reported by: Yichen Chai <yichen.chai@gmail.com>, Zhuo Ying Jiang Li <zyj20@cl.cam.ac.uk>
MFC after: 3 days
Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
kpAuthored on Mon, Jan 6, 6:56 AM
Parents
rGd355c28a0954: depend-cleanup: bea89d038ac5 also moved memchr
Branches
Unknown
Tags
Unknown