linux/net
Eric Dumazet ec00ed472b tcp: avoid premature drops in tcp_add_backlog()
While testing TCP performance with latest trees,
I saw suspect SOCKET_BACKLOG drops.

tcp_add_backlog() computes its limit with :

    limit = (u32)READ_ONCE(sk->sk_rcvbuf) +
            (u32)(READ_ONCE(sk->sk_sndbuf) >> 1);
    limit += 64 * 1024;

This does not take into account that sk->sk_backlog.len
is reset only at the very end of __release_sock().

Both sk->sk_backlog.len and sk->sk_rmem_alloc could reach
sk_rcvbuf in normal conditions.

We should double sk->sk_rcvbuf contribution in the formula
to absorb bubbles in the backlog, which happen more often
for very fast flows.

This change maintains decent protection against abuses.

Fixes: c377411f24 ("net: sk_add_backlog() take rmem_alloc into account")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://lore.kernel.org/r/20240423125620.3309458-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2024-04-25 12:15:02 -07:00
..
6lowpan net: fill in MODULE_DESCRIPTION()s for 6LoWPAN 2024-02-09 14:12:01 -08:00
9p 9p: Fix read/write debug statements to report server reply 2024-02-12 21:18:54 +09:00
802
8021q netlink: introduce type-checking attribute iteration 2024-03-29 15:06:02 -07:00
appletalk net: remove SOCK_DEBUG leftovers 2023-12-26 20:31:01 +00:00
atm ipv4: Set scope explicitly in ip_route_output(). 2024-04-08 13:20:51 +01:00
ax25 sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
batman-adv Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-04-11 14:23:47 -07:00
bluetooth Bluetooth: l2cap: Don't double set the HCI_CONN_MGMT_CONNECTED bit 2024-04-10 15:10:16 -04:00
bpf bpf: Check return from set_memory_rox() 2024-03-18 14:18:47 -07:00
bridge net: bridge: remove redundant check of f->dst 2024-04-25 13:15:38 +01:00
caif caif: Use UTILITY_NAME_LENGTH instead of hard-coding 16 2024-04-02 18:20:00 -07:00
can linux-can-next-for-6.9-20240220 2024-02-20 15:32:45 +01:00
ceph libceph: init the cursor when preparing sparse read in msgr2 2024-03-06 12:43:01 +01:00
core net: create a dummy net_device allocator 2024-04-24 12:00:16 +01:00
dcb
dccp tcp/dccp: do not care about families in inet_twsk_purge() 2024-04-01 21:27:58 -07:00
devlink devlink: extend devlink_param *set pointer 2024-04-22 13:05:19 -07:00
dns_resolver Networking changes for 6.8. 2024-01-11 10:07:29 -08:00
dsa devlink: extend devlink_param *set pointer 2024-04-22 13:05:19 -07:00
ethernet
ethtool net: ethtool: pse-pd: Expand pse commands with the PSE PoE interface 2024-04-18 18:27:02 -07:00
handshake net/handshake: remove redundant assignment to variable ret 2024-04-16 17:14:55 -07:00
hsr net: hsr: Use full string description when opening HSR network device 2024-03-29 10:42:21 +00:00
ieee802154 sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
ife net: sched: ife: fix potential use-after-free 2023-12-15 10:50:18 +00:00
ipv4 tcp: avoid premature drops in tcp_add_backlog() 2024-04-25 12:15:02 -07:00
ipv6 sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
iucv net/iucv: Avoid explicit cpumask var allocation on stack 2024-04-02 18:19:09 -07:00
kcm net: kcm: fix incorrect parameter validation in the kcm_getsockopt) function 2024-03-11 09:53:22 +00:00
key net: fill in MODULE_DESCRIPTION()s for af_key 2024-02-09 14:12:01 -08:00
l2tp l2tp: fix incorrect parameter validation in the pppol2tp_getsockopt() function 2024-03-11 09:53:22 +00:00
l3mdev
lapb
llc llc: call sock_orphan() at release time 2024-01-30 13:49:09 +01:00
mac80211 wifi: mac80211: handle link ID during management Tx 2024-04-19 10:54:58 +02:00
mac802154 mac802154: fix llsec key resources release in mac802154_llsec_key_del 2024-03-06 21:01:26 +01:00
mctp Merge git://git.kernel.org/pub/scm/linux/kernel/git/netdev/net 2024-02-29 14:24:56 -08:00
mpls sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
mptcp sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
ncsi
netfilter netfilter: nfnetlink: Handle ACK flags for batch messages 2024-04-22 17:20:42 -07:00
netlabel netlabel: remove impossible return value in netlbl_bitmap_walk 2024-02-28 19:37:34 -08:00
netlink netlink: support all extack types in dumps 2024-04-23 10:09:49 -07:00
netrom netrom: Fix data-races around sysctl_net_busy_read 2024-03-07 10:36:58 +01:00
nfc net: nfc: remove inappropriate attrs check 2024-04-12 18:52:35 -07:00
nsh
openvswitch net: openvswitch: Release reference to netdev 2024-04-24 17:07:17 -07:00
packet af_packet: avoid a false positive warning in packet_setsockopt() 2024-04-08 13:19:01 +01:00
phonet phonet/pep: fix racy skb_queue_empty() use 2024-02-22 09:05:50 +01:00
psample ip_tunnel: convert __be16 tunnel flags to bitmaps 2024-04-01 10:49:28 +01:00
qrtr net: qrtr: ns: Return 0 if server port is not present 2024-01-01 18:41:29 +00:00
rds net/rds: fix possible cp null dereference 2024-03-29 12:04:09 -07:00
rfkill net: rfkill: gpio: Convert to platform remove callback returning void 2024-03-25 15:40:22 +01:00
rose net/rose: fix races in rose_kill_by_device() 2023-12-15 11:59:53 +00:00
rxrpc net: add sk_wake_async_rcu() helper 2024-03-29 15:03:11 -07:00
sched net_sched: sch_skbprio: implement lockless skbprio_dump() 2024-04-19 11:34:08 +01:00
sctp sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
smc sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
strparser
sunrpc nfsd-6.9 fixes: 2024-04-06 09:37:50 -07:00
switchdev net: bridge: switchdev: Skip MDB replays of deferred events on offload 2024-02-16 09:36:37 +00:00
tipc tipc: remove redundant assignment to ret, simplify code 2024-04-12 19:07:31 -07:00
tls tls: remove redundant assignment to variable decrypted 2024-04-11 20:00:22 -07:00
unix af_unix: Don't access successor in unix_del_edges() during GC. 2024-04-23 13:57:35 +02:00
vmw_vsock vsock/virtio: fix packet delivery to tap device 2024-04-02 18:00:24 -07:00
wireless wifi: cfg80211: add return docs for regulatory functions 2024-04-19 10:29:08 +02:00
x25 net/x25: fix incorrect parameter validation in the x25_getsockopt() function 2024-03-11 09:53:22 +00:00
xdp xsk: validate user input for XDP_{UMEM|COMPLETION}_FILL_RING 2024-04-05 22:47:22 -07:00
xfrm sysctl: treewide: constify ctl_table_header::ctl_table_arg 2024-04-22 08:56:31 +01:00
compat.c file: stop exposing receive_fd_user() 2023-12-12 14:24:14 +01:00
devres.c
Kconfig net: skbuff: generalize the skb->decrypted bit 2024-04-06 17:34:31 +01:00
Kconfig.debug
Makefile af_unix: Remove CONFIG_UNIX_SCM. 2024-01-31 16:41:16 -08:00
socket.c net: remove {revc,send}msg_copy_msghdr() from exports 2024-03-14 16:48:53 -07:00
sysctl_net.c