freebsd-dev/sys/netinet6
Andrew Gallatin 9ba117960e Fix a memory leak when ip_output_send() returns EAGAIN due to send tag issues
When ip_output_send() returns EAGAIN due to issues with send tags (route
change, lagg failover, etc), it must free the mbuf. This is because
ip_output_send() was written as a wrapper/replacement for a direct
call to  if_output(), and the contract with if_output() has
historically been that it owns the mbufs once called. When
ip_output_send() failed to free mbufs, it violated this assumption
and lead to leaked mbufs.

This was noticed when using NIC TLS in combination with hardware
rate-limited connections. When seeing lots of NIC output drops
triggered ratelimit send tag changes, we noticed we were leaking
ktls_sessions, send tags and mbufs. This was due ip_output_send()
leaking mbufs which held references to ktls_sessions, which in
turn held references to send tags.

Many thanks to jbh, rrs, hselasky and markj for their help in
debugging this.

Sponsored by: Netflix
Differential Revision: https://reviews.freebsd.org/D34054
Reviewed by: hselasky, jhb, rrs
MFC after: 2 weeks
2022-01-27 10:34:34 -05: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 netinet6: Fix a typo in a sysctl description 2021-11-30 07:24:44 +01:00
icmp6.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
icmp6.h
in6_cksum.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
in6_fib_algo.c Fix dpdk/ldradix fib lookup algorithm preference calculation. 2021-03-07 22:17:53 +00:00
in6_fib.c Fix unused-function waring when compiling with FIB_ALGO. 2021-01-30 23:25:56 +00:00
in6_fib.h Add modular fib lookup framework. 2020-12-25 11:33:17 +00:00
in6_gif.c net: Introduce IPV6_DSCP(), IPV6_ECN() and IPV6_TRAFFIC_CLASS() macros 2021-03-04 20:56:48 +01:00
in6_ifattach.c nd6: Mark several callouts as MPSAFE 2021-08-09 13:27:52 -04:00
in6_ifattach.h
in6_jail.c jail: network epoch protection for IP address lists 2021-12-26 10:45:50 -08:00
in6_mcast.c in6p_set_multicast_if(): fix malloc(M_WAITOK) with epoch 2021-12-06 14:33:23 -08:00
in6_pcb.c in_pcb: use jenkins hash over the entire IPv6 (or IPv4) address 2021-12-26 10:47:28 -08:00
in6_pcb.h Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
in6_proto.c domains: make domain_init() initialize only global state 2022-01-03 10:15:22 -08:00
in6_rmx.c in6_rmx: remove unnecessary TCP includes 2021-11-18 00:54:29 -08:00
in6_rss.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
in6_rss.h Implement flowid calculation for outbound connections to balance 2020-10-18 17:15:47 +00:00
in6_src.c Move in6_pcbsetport() to in6_pcb.c 2021-10-18 10:19:03 -07:00
in6_var.h if_stf: add 6rd support 2021-11-20 19:29:01 +01:00
in6.c [lltable] Add per-family lltable getters. 2021-12-29 20:57:15 +00:00
in6.h Add in_localip_fib(), in6_localip_fib(). 2021-11-12 08:59:42 -08:00
ip6_ecn.h
ip6_fastfwd.c net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
ip6_forward.c ipv6: quit dropping packets looping back on p2p interfaces 2020-08-31 01:45:48 +00:00
ip6_gre.c Revert "wpa: Import wpa_supplicant/hostapd commit 14ab4a816" 2021-12-02 14:45:04 -08:00
ip6_id.c
ip6_input.c protocols: init with standard SYSINIT(9) or VNET_SYSINIT 2022-01-03 10:15:21 -08:00
ip6_mroute.c ifnet_byindex() actually requires network epoch 2021-12-06 09:32:31 -08:00
ip6_mroute.h
ip6_output.c Fix a memory leak when ip_output_send() returns EAGAIN due to send tag issues 2022-01-27 10:34:34 -05:00
ip6_var.h protocols: init with standard SYSINIT(9) or VNET_SYSINIT 2022-01-03 10:15:21 -08:00
ip6.h
ip6protosw.h
ip_fw_nat64.h
ip_fw_nptv6.h net: clean up empty lines in .c and .h files 2020-09-01 21:19:14 +00:00
mld6_var.h icmpv6: Fix mbuf change in mld 2019-11-18 21:59:47 +00:00
mld6.c ifnet_byindex() actually requires network epoch 2021-12-06 09:32:31 -08:00
mld6.h
nd6_nbr.c nd6: use CARP link level address in SLLAO for NS sent out 2022-01-24 21:02:47 -08:00
nd6_rtr.c ifnet_byindex() actually requires network epoch 2021-12-06 09:32:31 -08:00
nd6.c inet6(4): Fix a few common typos in source code comments 2021-08-28 18:53:59 +02:00
nd6.h lltable: Add support for "child" LLEs holding encap for IPv4oIPv6 entries. 2021-08-21 17:34:35 +00:00
pim6_var.h
pim6.h
raw_ip6.c inet6: fix a LOR between rip and rawinp 2021-12-19 14:43:04 +00:00
raw_ip6.h
route6.c Fix m_pullup() problem after removing PULLDOWN_TESTs and KAME EXT_*macros. 2019-12-01 00:22:04 +00:00
scope6_var.h Make net.inet6.ip6.deembed_scopeid behaviour default & remove sysctl. 2020-08-15 11:37:44 +00:00
scope6.c ifnet_byindex() actually requires network epoch 2021-12-06 09:32:31 -08:00
sctp6_usrreq.c sctp: improve sctp_pathmtu_adjustment() 2021-12-30 15:16:05 +01:00
sctp6_var.h
send.c socket: Implement SO_RERROR 2021-07-28 09:35:09 -07:00
send.h
tcp6_var.h tcp: add support for TCP over UDP 2021-04-18 16:16:42 +02:00
udp6_usrreq.c udp6: remove assignments not being used 2022-01-01 19:25:47 +01:00
udp6_var.h