]> git.baikalelectronics.ru Git - kernel.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)
committerDavid S. Miller <davem@davemloft.net>
Wed, 22 Apr 2015 18:13:11 +0000 (14:13 -0400)
commite0454b507e4382e4f63cb4d3c136cacff59a0d17
treeb18a104e87454d5505c3d0e5f1c2e7f26ce9b89c
parent2ed22101c09a2eb6b5087f9213b48ac46d734c6e
tcp: fix possible deadlock in tcp_send_fin()

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 b7d497ca0fcc ("tcp: fix tcp fin memory accounting")

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