HomeFreeBSD

[udp6] fix possible panic due to lack of locking.

Description

[udp6] fix possible panic due to lack of locking.

The lookup for a IPv6 multicast addresses corresponding to
the destination address in the datagram is protected by the
NET_EPOCH section. Access to each PCB is protected by INP_RLOCK
during comparing. But access to socket's so_options field is
not protected. And in some cases it is possible, that PCB
pointer is still valid, but inp_socket is not. The patch wides
lock holding to protect access to inp_socket. It copies locking
strategy from IPv4 UDP handling.

PR: 232192
Obtained from: Yandex LLC
MFC after: 3 days
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D28232

Details

Provenance
aeAuthored on Feb 11 2021, 8:38 AM
Differential Revision
D28232: Fix possible panic in udp6_input() due to lack of locking.
Parents
rGdba7b0ef928a: Merge bmake-20210206
Branches
Unknown
Tags
Unknown