aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_ipv4.c
diff options
context:
space:
mode:
authorZhu Yi <[email protected]>2010-03-04 18:01:40 +0000
committerDavid S. Miller <[email protected]>2010-03-05 21:33:59 +0000
commit8eae939f1400326b06d0c9afe53d2a484a326871 (patch)
tree0896163cf1a00205fab76cc1c35855157a05cbbc /net/ipv4/tcp_ipv4.c
parentrndis_wlan: correct multicast_list handling V3 (diff)
downloadkernel-8eae939f1400326b06d0c9afe53d2a484a326871.tar.gz
kernel-8eae939f1400326b06d0c9afe53d2a484a326871.zip
net: add limit for socket backlog
We got system OOM while running some UDP netperf testing on the loopback device. The case is multiple senders sent stream UDP packets to a single receiver via loopback on local host. Of course, the receiver is not able to handle all the packets in time. But we surprisingly found that these packets were not discarded due to the receiver's sk->sk_rcvbuf limit. Instead, they are kept queuing to sk->sk_backlog and finally ate up all the memory. We believe this is a secure hole that a none privileged user can crash the system. The root cause for this problem is, when the receiver is doing __release_sock() (i.e. after userspace recv, kernel udp_recvmsg -> skb_free_datagram_locked -> release_sock), it moves skbs from backlog to sk_receive_queue with the softirq enabled. In the above case, multiple busy senders will almost make it an endless loop. The skbs in the backlog end up eat all the system memory. The issue is not only for UDP. Any protocols using socket backlog is potentially affected. The patch adds limit for socket backlog so that the backlog size cannot be expanded endlessly. Reported-by: Alex Shi <[email protected]> Cc: David Miller <[email protected]> Cc: Arnaldo Carvalho de Melo <[email protected]> Cc: Alexey Kuznetsov <[email protected] Cc: "Pekka Savola (ipv6)" <[email protected]> Cc: Patrick McHardy <[email protected]> Cc: Vlad Yasevich <[email protected]> Cc: Sridhar Samudrala <[email protected]> Cc: Jon Maloy <[email protected]> Cc: Allan Stephens <[email protected]> Cc: Andrew Hendry <[email protected]> Signed-off-by: Zhu Yi <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Acked-by: Arnaldo Carvalho de Melo <[email protected]> Signed-off-by: David S. Miller <[email protected]>
Diffstat (limited to 'net/ipv4/tcp_ipv4.c')
0 files changed, 0 insertions, 0 deletions