]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
tcp: fix possible deadlock in tcp_send_fin()
authorEric Dumazet <edumazet@google.com>
Wed, 22 Apr 2015 01:32:24 +0000 (18:32 -0700)
committerJiri Slaby <jslaby@suse.cz>
Thu, 30 Apr 2015 11:28:08 +0000 (13:28 +0200)
commit3644030ff70814406747455e2997cb5d000a8bf7
tree0441a06a0e062777b0b645935f3ccc5953f0bc5d
parent70c3d4ae1322b9e9bd7443ef574af5635234a0fa
tcp: fix possible deadlock in tcp_send_fin()

[ Upstream commit d83769a580f1132ac26439f50068a29b02be535e ]

Using sk_stream_alloc_skb() in tcp_send_fin() is dangerous in
case a huge process is killed by OOM, and tcp_mem[2] is hit.

To be able to free memory we need to make progress, so this
patch allows FIN packets to not care about tcp_mem[2], if
skb allocation succeeded.

In a follow-up patch, we might abort tcp_send_fin() infinite loop
in case TIF_MEMDIE is set on this thread, as memory allocator
did its best getting extra memory already.

This patch reverts d22e15371811 ("tcp: fix tcp fin memory accounting")

Fixes: d22e15371811 ("tcp: fix tcp fin memory accounting")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Jiri Slaby <jslaby@suse.cz>
net/ipv4/tcp_output.c