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)
Sat, Sep 27, 2:40 AM
Unknown Object (File)
Thu, Sep 18, 8:13 PM
Unknown Object (File)
Wed, Sep 17, 6:01 AM
Unknown Object (File)
Tue, Sep 16, 11:52 AM
Unknown Object (File)
Tue, Sep 16, 8:41 AM
Unknown Object (File)
Sat, Sep 13, 7:25 AM
Unknown Object (File)
Sep 5 2025, 4:28 PM
Unknown Object (File)
Sep 3 2025, 8:11 PM

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