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
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
in6_fib_algo.c
in6_fib.c
in6_fib.h
in6_gif.c
in6_ifattach.c
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
in6_src.c
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
ip6_forward.c
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
mld6_var.h
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
nd6.h
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
scope6_var.h
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
send.h
tcp6_var.h
udp6_usrreq.c udp6: remove assignments not being used 2022-01-01 19:25:47 +01:00
udp6_var.h