diff options
author | Florian Westphal <fw@strlen.de> | 2012-11-21 20:32:46 -0500 |
---|---|---|
committer | Pablo Neira Ayuso <pablo@netfilter.org> | 2012-12-03 09:13:10 -0500 |
commit | 6d1fafcaecaa2e66eb9861a39d22fc7380ce6f78 (patch) | |
tree | 69b8cb0fa22a5dc46a16ab59ebf5a65af5f99b6b /net/netfilter | |
parent | 0360ae412d09bc6f4864c801effcb20bfd84520e (diff) |
netfilter: ctnetlink: nla_policy updates
Add stricter checking for a few attributes.
Note that these changes don't fix any bug in the current code base.
Signed-off-by: Florian Westphal <fw@strlen.de>
Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter')
-rw-r--r-- | net/netfilter/nf_conntrack_netlink.c | 8 | ||||
-rw-r--r-- | net/netfilter/nf_conntrack_proto_tcp.c | 2 |
2 files changed, 8 insertions, 2 deletions
diff --git a/net/netfilter/nf_conntrack_netlink.c b/net/netfilter/nf_conntrack_netlink.c index c24a00a73c7b..4e078cd84d83 100644 --- a/net/netfilter/nf_conntrack_netlink.c +++ b/net/netfilter/nf_conntrack_netlink.c | |||
@@ -898,7 +898,8 @@ ctnetlink_parse_zone(const struct nlattr *attr, u16 *zone) | |||
898 | } | 898 | } |
899 | 899 | ||
900 | static const struct nla_policy help_nla_policy[CTA_HELP_MAX+1] = { | 900 | static const struct nla_policy help_nla_policy[CTA_HELP_MAX+1] = { |
901 | [CTA_HELP_NAME] = { .type = NLA_NUL_STRING }, | 901 | [CTA_HELP_NAME] = { .type = NLA_NUL_STRING, |
902 | .len = NF_CT_HELPER_NAME_LEN - 1 }, | ||
902 | }; | 903 | }; |
903 | 904 | ||
904 | static inline int | 905 | static inline int |
@@ -932,6 +933,8 @@ static const struct nla_policy ct_nla_policy[CTA_MAX+1] = { | |||
932 | [CTA_ID] = { .type = NLA_U32 }, | 933 | [CTA_ID] = { .type = NLA_U32 }, |
933 | [CTA_NAT_DST] = { .type = NLA_NESTED }, | 934 | [CTA_NAT_DST] = { .type = NLA_NESTED }, |
934 | [CTA_TUPLE_MASTER] = { .type = NLA_NESTED }, | 935 | [CTA_TUPLE_MASTER] = { .type = NLA_NESTED }, |
936 | [CTA_NAT_SEQ_ADJ_ORIG] = { .type = NLA_NESTED }, | ||
937 | [CTA_NAT_SEQ_ADJ_REPLY] = { .type = NLA_NESTED }, | ||
935 | [CTA_ZONE] = { .type = NLA_U16 }, | 938 | [CTA_ZONE] = { .type = NLA_U16 }, |
936 | [CTA_MARK_MASK] = { .type = NLA_U32 }, | 939 | [CTA_MARK_MASK] = { .type = NLA_U32 }, |
937 | }; | 940 | }; |
@@ -2322,7 +2325,8 @@ static const struct nla_policy exp_nla_policy[CTA_EXPECT_MAX+1] = { | |||
2322 | [CTA_EXPECT_MASK] = { .type = NLA_NESTED }, | 2325 | [CTA_EXPECT_MASK] = { .type = NLA_NESTED }, |
2323 | [CTA_EXPECT_TIMEOUT] = { .type = NLA_U32 }, | 2326 | [CTA_EXPECT_TIMEOUT] = { .type = NLA_U32 }, |
2324 | [CTA_EXPECT_ID] = { .type = NLA_U32 }, | 2327 | [CTA_EXPECT_ID] = { .type = NLA_U32 }, |
2325 | [CTA_EXPECT_HELP_NAME] = { .type = NLA_NUL_STRING }, | 2328 | [CTA_EXPECT_HELP_NAME] = { .type = NLA_NUL_STRING, |
2329 | .len = NF_CT_HELPER_NAME_LEN - 1 }, | ||
2326 | [CTA_EXPECT_ZONE] = { .type = NLA_U16 }, | 2330 | [CTA_EXPECT_ZONE] = { .type = NLA_U16 }, |
2327 | [CTA_EXPECT_FLAGS] = { .type = NLA_U32 }, | 2331 | [CTA_EXPECT_FLAGS] = { .type = NLA_U32 }, |
2328 | [CTA_EXPECT_CLASS] = { .type = NLA_U32 }, | 2332 | [CTA_EXPECT_CLASS] = { .type = NLA_U32 }, |
diff --git a/net/netfilter/nf_conntrack_proto_tcp.c b/net/netfilter/nf_conntrack_proto_tcp.c index 61f9285111d1..83876e9877f1 100644 --- a/net/netfilter/nf_conntrack_proto_tcp.c +++ b/net/netfilter/nf_conntrack_proto_tcp.c | |||
@@ -1353,6 +1353,8 @@ static const struct nla_policy tcp_timeout_nla_policy[CTA_TIMEOUT_TCP_MAX+1] = { | |||
1353 | [CTA_TIMEOUT_TCP_TIME_WAIT] = { .type = NLA_U32 }, | 1353 | [CTA_TIMEOUT_TCP_TIME_WAIT] = { .type = NLA_U32 }, |
1354 | [CTA_TIMEOUT_TCP_CLOSE] = { .type = NLA_U32 }, | 1354 | [CTA_TIMEOUT_TCP_CLOSE] = { .type = NLA_U32 }, |
1355 | [CTA_TIMEOUT_TCP_SYN_SENT2] = { .type = NLA_U32 }, | 1355 | [CTA_TIMEOUT_TCP_SYN_SENT2] = { .type = NLA_U32 }, |
1356 | [CTA_TIMEOUT_TCP_RETRANS] = { .type = NLA_U32 }, | ||
1357 | [CTA_TIMEOUT_TCP_UNACK] = { .type = NLA_U32 }, | ||
1356 | }; | 1358 | }; |
1357 | #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */ | 1359 | #endif /* CONFIG_NF_CT_NETLINK_TIMEOUT */ |
1358 | 1360 | ||