From: Greg Kroah-Hartman Date: Mon, 15 Aug 2022 13:14:26 +0000 (+0200) Subject: 4.14-stable patches X-Git-Tag: v5.15.61~49 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=c5ca4d61896add1e8b52d700ae115e534b6ddb8d;p=thirdparty%2Fkernel%2Fstable-queue.git 4.14-stable patches added patches: tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch --- diff --git a/queue-4.14/series b/queue-4.14/series index c8df1d56bd7..cfb59049f5d 100644 --- a/queue-4.14/series +++ b/queue-4.14/series @@ -169,3 +169,4 @@ btrfs-reject-log-replay-if-there-is-unsupported-ro-compat-flag.patch kvm-add-infrastructure-and-macro-to-mark-vm-as-bugged.patch kvm-x86-check-lapic_in_kernel-before-attempting-to-set-a-synic-irq.patch kvm-x86-avoid-theoretical-null-pointer-dereference-in-kvm_irq_delivery_to_apic_fast.patch +tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch diff --git a/queue-4.14/tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch b/queue-4.14/tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch new file mode 100644 index 00000000000..b23477ca972 --- /dev/null +++ b/queue-4.14/tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch @@ -0,0 +1,45 @@ +From c4ee118561a0f74442439b7b5b486db1ac1ddfeb Mon Sep 17 00:00:00 2001 +From: Eric Dumazet +Date: Tue, 14 Jun 2022 10:17:33 -0700 +Subject: tcp: fix over estimation in sk_forced_mem_schedule() + +From: Eric Dumazet + +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 +Acked-by: Soheil Hassas Yeganeh +Reviewed-by: Shakeel Butt +Reviewed-by: Wei Wang +Signed-off-by: David S. Miller +Signed-off-by: Greg Kroah-Hartman +--- + net/ipv4/tcp_output.c | 7 ++++--- + 1 file changed, 4 insertions(+), 3 deletions(-) + +--- a/net/ipv4/tcp_output.c ++++ b/net/ipv4/tcp_output.c +@@ -3086,11 +3086,12 @@ void tcp_xmit_retransmit_queue(struct so + */ + void sk_forced_mem_schedule(struct sock *sk, int size) + { +- int amt; ++ int delta, amt; + +- if (size <= sk->sk_forward_alloc) ++ delta = size - sk->sk_forward_alloc; ++ if (delta <= 0) + return; +- amt = sk_mem_pages(size); ++ amt = sk_mem_pages(delta); + sk->sk_forward_alloc += amt * SK_MEM_QUANTUM; + sk_memory_allocated_add(sk, amt); +