HomeFreeBSD

pf: Handle (*m0)->m_len < sizeof(struct ip) case

Description

pf: Handle (*m0)->m_len < sizeof(struct ip) case

if_enc(4) can pass IPsec payload to pfil(9) with the outer header or without
it. In case of a small packet like ICMP, when mbuf cluster is not used,
everything works fine. Otherwise, the first mbuf in a chain has m_len == 0
if it is asked to strip the outer header. pf was not handling such case, and
erroneous reading of the outer IP header led to unexpected behavior.

Reviewed by: kp, glebius
Differential Revision: https://reviews.freebsd.org/D45780

Details

Provenance
igor.ostapenko_pm.meAuthored on Tue, Jul 2, 12:41 PM
kpCommitted on Tue, Jul 2, 12:43 PM
Reviewer
kp
Differential Revision
D45780: pf: Handle (*m0)->m_len < sizeof(struct ip) case
Parents
rG087f5e08ab5f: if_vxlan(4): Plug a memory leak
Branches
Unknown
Tags
Unknown