Commit b685a65d authored by Jie Liu's avatar Jie Liu Committed by Kleber Sacilotto de Souza

tipc: set sysctl_tipc_rmem and named_timeout right range

BugLink: https://bugs.launchpad.net/bugs/1864773

[ Upstream commit 4bcd4ec1 ]

We find that sysctl_tipc_rmem and named_timeout do not have the right minimum
setting. sysctl_tipc_rmem should be larger than zero, like sysctl_tcp_rmem.
And named_timeout as a timeout setting should be not less than zero.

Fixes: cc79dd1b ("tipc: change socket buffer overflow control to respect sk_rcvbuf")
Fixes: a5325ae5 ("tipc: add name distributor resiliency queue")
Signed-off-by: default avatarJie Liu <liujie165@huawei.com>
Reported-by: default avatarQiang Ning <ningqiang1@huawei.com>
Reviewed-by: default avatarZhiqiang Liu <liuzhiqiang26@huawei.com>
Reviewed-by: default avatarMiaohe Lin <linmiaohe@huawei.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarSasha Levin <sashal@kernel.org>
Signed-off-by: default avatarKhalid Elmously <khalid.elmously@canonical.com>
Signed-off-by: default avatarKleber Sacilotto de Souza <kleber.souza@canonical.com>
parent c0331b87
...@@ -37,6 +37,8 @@ ...@@ -37,6 +37,8 @@
#include <linux/sysctl.h> #include <linux/sysctl.h>
static int zero;
static int one = 1;
static struct ctl_table_header *tipc_ctl_hdr; static struct ctl_table_header *tipc_ctl_hdr;
static struct ctl_table tipc_table[] = { static struct ctl_table tipc_table[] = {
...@@ -45,14 +47,16 @@ static struct ctl_table tipc_table[] = { ...@@ -45,14 +47,16 @@ static struct ctl_table tipc_table[] = {
.data = &sysctl_tipc_rmem, .data = &sysctl_tipc_rmem,
.maxlen = sizeof(sysctl_tipc_rmem), .maxlen = sizeof(sysctl_tipc_rmem),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec_minmax,
.extra1 = &one,
}, },
{ {
.procname = "named_timeout", .procname = "named_timeout",
.data = &sysctl_tipc_named_timeout, .data = &sysctl_tipc_named_timeout,
.maxlen = sizeof(sysctl_tipc_named_timeout), .maxlen = sizeof(sysctl_tipc_named_timeout),
.mode = 0644, .mode = 0644,
.proc_handler = proc_dointvec, .proc_handler = proc_dointvec_minmax,
.extra1 = &zero,
}, },
{} {}
}; };
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment