]> git.ipfire.org Git - thirdparty/kernel/stable-queue.git/commitdiff
4.14-stable patches
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2022 13:14:26 +0000 (15:14 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 15 Aug 2022 13:14:26 +0000 (15:14 +0200)
added patches:
tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch

queue-4.14/series
queue-4.14/tcp-fix-over-estimation-in-sk_forced_mem_schedule.patch [new file with mode: 0644]

index c8df1d56bd7352db73d6acf2042121b2d42b1ad2..cfb59049f5d3b129d79b811ea23b73b0b4047503 100644 (file)
@@ -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 (file)
index 0000000..b23477c
--- /dev/null
@@ -0,0 +1,45 @@
+From c4ee118561a0f74442439b7b5b486db1ac1ddfeb Mon Sep 17 00:00:00 2001
+From: Eric Dumazet <edumazet@google.com>
+Date: Tue, 14 Jun 2022 10:17:33 -0700
+Subject: tcp: fix over estimation in sk_forced_mem_schedule()
+
+From: Eric Dumazet <edumazet@google.com>
+
+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 |    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);