HomeFreeBSD

if_ovpn: deal with short packets

Description

if_ovpn: deal with short packets

If we receive a UDP packet (directed towards an active OpenVPN socket)
which is too short to contain an OpenVPN header ('struct
ovpn_wire_header') we wound up making m_copydata() read outside the
mbuf, and panicking the machine.

Explicitly check that the packet is long enough to copy the data we're
interested in. If it's not we will pass the packet to userspace, just
like we'd do for an unknown peer.

Extend a test case to provoke this situation.

Sponsored by: Rubicon Communications, LLC ("Netgate")

Details

Provenance
kpAuthored on Jul 5 2022, 5:27 PM
Parents
rGcbb019b831ad: dummynet: fix ip_dn_vnet_init() / dummynet_task() race
Branches
Unknown
Tags
Unknown