freebsd-src/sys/netinet6
Michael Tuexen fe1274ee39 Fix race when accepting TCP connections.
When expanding a SYN-cache entry to a socket/inp a two step approach was
taken:
1) The local address was filled in, then the inp was added to the hash
   table.
2) The remote address was filled in and the inp was relocated in the
   hash table.
Before the epoch changes, a write lock was held when this happens and
the code looking up entries was holding a corresponding read lock.
Since the read lock is gone away after the introduction of the
epochs, the half populated inp was found during lookup.
This resulted in processing TCP segments in the context of the wrong
TCP connection.
This patch changes the above procedure in a way that the inp is fully
populated before inserted into the hash table.

Thanks to Paul <devgs@ukr.net> for reporting the issue on the net@
mailing list and for testing the patch!

Reviewed by:		rrs@
MFC after:		1 week
Sponsored by:		Netflix, Inc.
Differential Revision:	https://reviews.freebsd.org/D22971
2020-01-12 17:52:32 +00:00
..
dest6.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
frag6.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
icmp6.c Make icmp6_reflect() static. 2019-12-03 14:46:38 +00:00
icmp6.h
in6.c Fix rtsock route message generation for interface addresses. 2020-01-07 21:16:30 +00:00
in6.h Convert all IPv4 and IPv6 multicast memberships into using a STAILQ 2019-06-25 11:54:41 +00:00
in6_cksum.c sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
in6_fib.c Switch RIB and RADIX_NODE_HEAD lock from rwlock(9) to rmlock(9). 2018-06-16 08:26:23 +00:00
in6_fib.h
in6_gif.c Add the check that current VNET is ready and access to srchash is allowed. 2018-10-23 13:11:45 +00:00
in6_ifattach.c Don't cover in6_ifattach() with network epoch, as it may call into 2019-10-13 04:25:16 +00:00
in6_ifattach.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
in6_jail.c Move most of the contents of opt_compat.h to opt_global.h. 2018-04-06 17:35:35 +00:00
in6_mcast.c in6_mcast: make in6_joingroup_locked() static 2020-01-11 18:55:12 +00:00
in6_pcb.c Fix race when accepting TCP connections. 2020-01-12 17:52:32 +00:00
in6_pcb.h Fix race when accepting TCP connections. 2020-01-12 17:52:32 +00:00
in6_pcbgroup.c sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
in6_proto.c Add fibnum, family and vnet pointer to each rib head. 2020-01-09 17:21:00 +00:00
in6_rmx.c Add fibnum, family and vnet pointer to each rib head. 2020-01-09 17:21:00 +00:00
in6_rss.c
in6_rss.h
in6_src.c IPv6 cleanup: kernel 2019-08-02 07:41:36 +00:00
in6_var.h in6_mcast: make in6_joingroup_locked() static 2020-01-11 18:55:12 +00:00
ip6.h
ip6_ecn.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ip6_fastfwd.c New pfil(9) KPI together with newborn pfil API and control utility. 2019-01-31 23:01:03 +00:00
ip6_forward.c Add a missing include of opt_sctp.h. 2019-10-12 22:58:33 +00:00
ip6_gre.c Add GRE-in-UDP encapsulation support as defined in RFC8086. 2019-04-24 09:05:45 +00:00
ip6_id.c ip6_randomflowlabel: Avoid blocking if random(4) is not available 2019-04-23 17:18:20 +00:00
ip6_input.c Update comment. 2019-12-06 16:53:42 +00:00
ip6_mroute.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
ip6_mroute.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ip6_output.c In r343631 error code for a packet blocked by a firewall was 2020-01-01 17:32:20 +00:00
ip6_var.h frag6: replace KAME hand-rolled queues with queue(9) TAILQs 2019-10-23 23:01:18 +00:00
ip6protosw.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
ip_fw_nat64.h Reapply r345274 with build fixes for 32-bit architectures. 2019-03-19 10:57:03 +00:00
ip_fw_nptv6.h Add ability to use dynamic external prefix in ipfw_nptv6 module. 2018-11-12 11:20:59 +00:00
mld6.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
mld6.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
mld6_var.h icmpv6: Fix mbuf change in mld 2019-11-18 21:59:47 +00:00
nd6.c nd6: sysctl 2019-11-19 21:08:18 +00:00
nd6.h nd6_rtr: make nd6_prefix_onlink() static 2020-01-12 16:58:21 +00:00
nd6_nbr.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
nd6_rtr.c nd6_rtr: constantly use __func__ for nd6log() 2020-01-12 17:41:09 +00:00
pim6.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
pim6_var.h Rework IP encapsulation handling code. 2018-06-05 20:51:01 +00:00
raw_ip6.c Remove unnecessary recursive epoch enter via INP_INFO_RLOCK 2019-11-07 20:40:44 +00:00
raw_ip6.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
route6.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
scope6.c Mechanical cleanup of epoch(9) usage in network stack. 2019-01-09 01:11:19 +00:00
scope6_var.h Constify argument of in6_getscope(). 2018-06-05 20:54:29 +00:00
sctp6_usrreq.c Update the hostcache also for PTB messages received for SCTP/IPv6. 2019-12-01 16:14:44 +00:00
sctp6_var.h Whitespace changes due to changes in ident. 2018-07-19 20:16:33 +00:00
send.c Use the new VNET_DEFINE_STATIC macro when we are defining static VNET 2018-07-24 16:35:52 +00:00
send.h sys: general adoption of SPDX licensing ID tags. 2017-11-27 15:23:17 +00:00
tcp6_var.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00
udp6_usrreq.c vnet: virtualise more network stack sysctls. 2020-01-08 23:30:26 +00:00
udp6_var.h sys: further adoption of SPDX licensing ID tags. 2017-11-20 19:43:44 +00:00