]> git.proxmox.com Git - mirror_ubuntu-jammy-kernel.git/commit
tcp: add accessors to read/set tp->snd_cwnd
authorEric Dumazet <edumazet@google.com>
Tue, 5 Apr 2022 23:35:38 +0000 (16:35 -0700)
committerStefan Bader <stefan.bader@canonical.com>
Fri, 26 Aug 2022 08:52:48 +0000 (10:52 +0200)
commit0d24ea1d05ce1829f4ef03131b3f2218bca773db
treeee1a068aef36c506e195700c3af01f33b1013f40
parentf3c09aff8687e6d5a91c07da327765fef53d7f22
tcp: add accessors to read/set tp->snd_cwnd

BugLink: https://bugs.launchpad.net/bugs/1982968
[ Upstream commit 40570375356c874b1578e05c1dcc3ff7c1322dbe ]

We had various bugs over the years with code
breaking the assumption that tp->snd_cwnd is greater
than zero.

Lately, syzbot reported the WARN_ON_ONCE(!tp->prior_cwnd) added
in commit 8b8a321ff72c ("tcp: fix zero cwnd in tcp_cwnd_reduction")
can trigger, and without a repro we would have to spend
considerable time finding the bug.

Instead of complaining too late, we want to catch where
and when tp->snd_cwnd is set to an illegal value.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Suggested-by: Yuchung Cheng <ycheng@google.com>
Cc: Neal Cardwell <ncardwell@google.com>
Acked-by: Yuchung Cheng <ycheng@google.com>
Link: https://lore.kernel.org/r/20220405233538.947344-1-eric.dumazet@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
27 files changed:
include/net/tcp.h
include/trace/events/tcp.h
net/core/filter.c
net/ipv4/tcp.c
net/ipv4/tcp_bbr.c
net/ipv4/tcp_bic.c
net/ipv4/tcp_cdg.c
net/ipv4/tcp_cong.c
net/ipv4/tcp_cubic.c
net/ipv4/tcp_dctcp.c
net/ipv4/tcp_highspeed.c
net/ipv4/tcp_htcp.c
net/ipv4/tcp_hybla.c
net/ipv4/tcp_illinois.c
net/ipv4/tcp_input.c
net/ipv4/tcp_ipv4.c
net/ipv4/tcp_lp.c
net/ipv4/tcp_metrics.c
net/ipv4/tcp_nv.c
net/ipv4/tcp_output.c
net/ipv4/tcp_rate.c
net/ipv4/tcp_scalable.c
net/ipv4/tcp_vegas.c
net/ipv4/tcp_veno.c
net/ipv4/tcp_westwood.c
net/ipv4/tcp_yeah.c
net/ipv6/tcp_ipv6.c