HomeFreeBSD

udp: improve handling of cached route

Description

udp: improve handling of cached route

The inp_route pointer should only be provided to the network
layer, when no destination address is provided. This is only
one of the conditions, where a write lock is needed.
If, for example, the route is also cached, when the socket is
unbound, problems show up, when the sendto is called, then
connect and finally send, when the route for the addresses
provided in the sendto and connect call use different outgoing
interfaces.
While there, clearly document why the write lock is taken.

Reported by: syzbot+59122d2e848087d3355a@syzkaller.appspotmail.com
Reviewed by: Peter Lei, glebius
MFC after: 3 days
Sponsored by: Netflix, Inc.
Differential Revision: https://reviews.freebsd.org/D46056

Details

Provenance
tuexenAuthored on Jul 28 2024, 9:25 PM
Reviewer
peter
Differential Revision
D46056: udp: improve handling of cached route
Parents
rG34f746cc7f8a: libm: fma: correct zero sign with small inputs
Branches
Unknown
Tags
Unknown
Reverted By
rG4d32367a44e0: Revert "udp: improve handling of cached route"