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
Sponsored by: Yandex LLC
Differential Revision: https://reviews.freebsd.org/D28232

(cherry picked from commit 3c782d9c91666886d868426f0aea040d1a1a8ee4)

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
rG9f46322cad47: [udp] fix possible mbuf and lock leak in udp_input().
Branches
Unknown
Tags
Unknown