|
@@ -150,6 +150,9 @@ nfnl_cthelper_expect_policy(struct nf_conntrack_expect_policy *expect_policy,
|
|
|
nla_data(tb[NFCTH_POLICY_NAME]), NF_CT_HELPER_NAME_LEN);
|
|
|
expect_policy->max_expected =
|
|
|
ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_MAX]));
|
|
|
+ if (expect_policy->max_expected > NF_CT_EXPECT_MAX_CNT)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
expect_policy->timeout =
|
|
|
ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_TIMEOUT]));
|
|
|
|
|
@@ -290,6 +293,9 @@ nfnl_cthelper_update_policy_one(const struct nf_conntrack_expect_policy *policy,
|
|
|
|
|
|
new_policy->max_expected =
|
|
|
ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_MAX]));
|
|
|
+ if (new_policy->max_expected > NF_CT_EXPECT_MAX_CNT)
|
|
|
+ return -EINVAL;
|
|
|
+
|
|
|
new_policy->timeout =
|
|
|
ntohl(nla_get_be32(tb[NFCTH_POLICY_EXPECT_TIMEOUT]));
|
|
|
|