]> git.baikalelectronics.ru Git - kernel.git/commit
tcp: fix potential huge kmalloc() calls in TCP_REPAIR
authorEric Dumazet <edumazet@google.com>
Thu, 19 Nov 2015 05:03:33 +0000 (21:03 -0800)
committerDavid S. Miller <davem@davemloft.net>
Fri, 20 Nov 2015 15:57:33 +0000 (10:57 -0500)
commitb52bdd8ee5edb67c0ef93b8934d3ed9071fc11c1
tree2d59e7176c7c351ca7113839fa6f8db42762d43e
parent3410124c459bc78143ae9605e349b4c35409054f
tcp: fix potential huge kmalloc() calls in TCP_REPAIR

tcp_send_rcvq() is used for re-injecting data into tcp receive queue.

Problems :

- No check against size is performed, allowed user to fool kernel in
  attempting very large memory allocations, eventually triggering
  OOM when memory is fragmented.

- In case of fault during the copy we do not return correct errno.

Lets use alloc_skb_with_frags() to cook optimal skbs.

Fixes: e2b7356de548 ("tcp: Move rcvq sending to tcp_input.c")
Fixes: a17d23872e45 ("tcp: Repair socket queues")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Pavel Emelyanov <xemul@parallels.com>
Acked-by: Pavel Emelyanov <xemul@parallels.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/ipv4/tcp_input.c