summaryrefslogtreecommitdiff
path: root/net/netfilter/nf_conntrack_irc.c
diff options
context:
space:
mode:
authorGao Feng <fgao@ikuai8.com>2017-03-24 21:32:19 +0800
committerPablo Neira Ayuso <pablo@netfilter.org>2017-04-06 18:32:16 +0200
commit92f73221f9e9e143d242e3eca9c512dac969765e (patch)
tree9c493bd487511b3230393788568bfe3ae3ae81a2 /net/netfilter/nf_conntrack_irc.c
parentf323d9546927a012cafbb7e503e6aa0e9fbff94b (diff)
netfilter: expect: Make sure the max_expected limit is effective
Because the type of expecting, the member of nf_conn_help, is u8, it would overflow after reach U8_MAX(255). So it doesn't work when we configure the max_expected exceeds 255 with expect policy. Now add the check for max_expected. Return the -EINVAL when it exceeds the limit. Signed-off-by: Gao Feng <fgao@ikuai8.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/nf_conntrack_irc.c')
-rw-r--r--net/netfilter/nf_conntrack_irc.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/net/netfilter/nf_conntrack_irc.c b/net/netfilter/nf_conntrack_irc.c
index 1972a149f958..1a5af4d4af2d 100644
--- a/net/netfilter/nf_conntrack_irc.c
+++ b/net/netfilter/nf_conntrack_irc.c
@@ -243,6 +243,12 @@ static int __init nf_conntrack_irc_init(void)
return -EINVAL;
}
+ if (max_dcc_channels > NF_CT_EXPECT_MAX_CNT) {
+ pr_err("max_dcc_channels must not be more than %u\n",
+ NF_CT_EXPECT_MAX_CNT);
+ return -EINVAL;
+ }
+
irc_exp_policy.max_expected = max_dcc_channels;
irc_exp_policy.timeout = dcc_timeout;