Page MenuHomeFreeBSD

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

Authored by markj on Jul 25 2025, 2:27 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, May 11, 10:19 PM
Unknown Object (File)
Mon, May 11, 8:52 PM
Unknown Object (File)
Apr 28 2026, 10:52 PM
Unknown Object (File)
Apr 28 2026, 12:39 AM
Unknown Object (File)
Apr 27 2026, 9:51 PM
Unknown Object (File)
Apr 25 2026, 5:34 AM
Unknown Object (File)
Apr 23 2026, 12:23 PM
Unknown Object (File)
Apr 23 2026, 8:13 AM

Details

Summary

When the socket has a tunneling function attached, udp_append() drops
the inpcb lock before calling it. To keep the inpcb live, we take a
reference. After commit 742e7210d00b we only dropped the reference if
the tunnel consumed the packet, but we need to drop it in either case.

Fixes: 742e7210d00b ("udp: allow udp_tun_func_t() to indicate it did not eat the packet")

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable