tcp: fix over estimation in sk_forced_mem_schedule()
authorEric Dumazet <edumazet@google.com>
Tue, 14 Jun 2022 17:17:33 +0000 (10:17 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 25 Aug 2022 09:11:30 +0000 (11:11 +0200)
commit2aa3bcb00558928fc0987b1346f9742ee91d3605
tree2a2f1c742f20394ad87ce4d96601d947d3ae4c72
parentbcf0a450fbaabe7e14d71f885525805b4f86e855
tcp: fix over estimation in sk_forced_mem_schedule()

commit c4ee118561a0f74442439b7b5b486db1ac1ddfeb upstream.

sk_forced_mem_schedule() has a bug similar to ones fixed
in commit 7c80b038d23e ("net: fix sk_wmem_schedule() and
sk_rmem_schedule() errors")

While this bug has little chance to trigger in old kernels,
we need to fix it before the following patch.

Fixes: d83769a580f1 ("tcp: fix possible deadlock in tcp_send_fin()")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Acked-by: Soheil Hassas Yeganeh <soheil@google.com>
Reviewed-by: Shakeel Butt <shakeelb@google.com>
Reviewed-by: Wei Wang <weiwan@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_output.c