HomeFreeBSD

udp: Fix a inpcb refcount leak in the tunnel receive path

Description

udp: Fix a inpcb refcount leak in the tunnel receive path

When the socket has a tunneling function attached, udp_append() drops
the inpcb lock before calling it. To keep the inpcb alive, we bump the
refcount. After commit 742e7210d00b we only dropped the reference if
the tunnel consumed the packet, but it needs to be dropped in either
case. if_ovpn is the only driver that can trigger this bug.

Fixes: 742e7210d00b ("udp: allow udp_tun_func_t() to indicate it did not eat the packet")
Reviewed by: kp
MFC after: 2 weeks
Sponsored by: Stormshield
Sponsored by: Klara, Inc.
Differential Revision: https://reviews.freebsd.org/D51505

Details

Provenance
markjAuthored on Jul 25 2025, 1:10 PM
Reviewer
kp
Differential Revision
D51505: udp: Fix a refcount leak in the tunnel receive path
Parents
rGc6da58bc17fa: UPDATING: note the new gssd package
Branches
Unknown
Tags
Unknown