summaryrefslogtreecommitdiffstats
path: root/usr.sbin/sade
diff options
context:
space:
mode:
authorrwatson <rwatson@FreeBSD.org>2004-11-04 01:25:23 +0000
committerrwatson <rwatson@FreeBSD.org>2004-11-04 01:25:23 +0000
commitf00509ea8d7d9f723ccb90046d98cebce2b972bf (patch)
tree26f85309b9bfb45edc8a781b1f2fc5ce5784ea94 /usr.sbin/sade
parent43d29263e9271ef63fcc8e0b9c9d06b80c8ec3a2 (diff)
downloadFreeBSD-src-f00509ea8d7d9f723ccb90046d98cebce2b972bf.zip
FreeBSD-src-f00509ea8d7d9f723ccb90046d98cebce2b972bf.tar.gz
Until this change, the UDP input code used global variables udp_in,
udp_in6, and udp_ip6 to pass socket address state between udp_input(), udp_append(), and soappendaddr_locked(). While file in the default configuration, when running with multiple netisrs or direct ithread dispatch, this can result in races wherein user processes using recvmsg() get back the wrong source IP/port. To correct this and related races: - Eliminate udp_ip6, which is believed to be generated but then never used. Eliminate ip_2_ip6_hdr() as it is now unneeded. - Eliminate setting, testing, and existence of 'init' status fields for the IPv6 structures. While with multiple UDP delivery this could lead to amortization of IPv4 -> IPv6 conversion when delivering an IPv4 UDP packet to an IPv6 socket, it added substantial complexity and side effects. - Move global structures into the stack, declaring udp_in in udp_input(), and udp_in6 in udp_append() to be used if a conversion is required. Pass &udp_in into udp_append(). - Re-annotate comments to reflect updates. With this change, UDP appears to operate correctly in the presence of substantial inbound processing parallelism. This solution avoids introducing additional synchronization, but does increase the potential stack depth. Discovered by: kris (Bug Magnet) MFC after: 3 weeks
Diffstat (limited to 'usr.sbin/sade')
0 files changed, 0 insertions, 0 deletions
OpenPOWER on IntegriCloud