]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
net: avoid to hang up on sending due to sysctl configuration overflow.
authorbingtian.ly@taobao.com <bingtian.ly@taobao.com>
Wed, 23 Jan 2013 20:35:28 +0000 (20:35 +0000)
committerZefan Li <lizefan@huawei.com>
Mon, 21 Mar 2016 01:17:56 +0000 (09:17 +0800)
commitd865a115933e9edbd86aa36dbfe8d42e2fc5f2a5
tree035cc28a267f45244daa8724896794b9c37356cc
parent3cda8eb001f93b7beb18d37efb87f88af8f401ea
net: avoid to hang up on sending due to sysctl configuration overflow.

commit cdda88912d62f9603d27433338a18be83ef23ac1 upstream.

    I found if we write a larger than 4GB value to some sysctl
variables, the sending syscall will hang up forever, because these
variables are 32 bits, such large values make them overflow to 0 or
negative.

    This patch try to fix overflow or prevent from zero value setup
of below sysctl variables:

net.core.wmem_default
net.core.rmem_default

net.core.rmem_max
net.core.wmem_max

net.ipv4.udp_rmem_min
net.ipv4.udp_wmem_min

net.ipv4.tcp_wmem
net.ipv4.tcp_rmem

Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: Li Yu <raise.sail@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
[lizf: Backported to 3.4: adjust context]
Signed-off-by: Zefan Li <lizefan@huawei.com>
net/core/sysctl_net_core.c
net/ipv4/sysctl_net_ipv4.c