aboutsummaryrefslogtreecommitdiffstats
path: root/net/netfilter/ipset/ip_set_list_set.c
diff options
context:
space:
mode:
authorSergey Popovich <popovich_sergei@mail.ua>2015-05-02 19:28:16 +0200
committerPablo Neira Ayuso <pablo@netfilter.org>2015-05-13 13:25:47 +0200
commit037261866c8dd164c426580160973eb2d68f688c (patch)
treef3a6c97734ebde8232d01ac6fde95fa5bb51f3a2 /net/netfilter/ipset/ip_set_list_set.c
parentnetfilter: ipset: Return bool values instead of int (diff)
downloadlinux-dev-037261866c8dd164c426580160973eb2d68f688c.tar.xz
linux-dev-037261866c8dd164c426580160973eb2d68f688c.zip
netfilter: ipset: Check for comment netlink attribute length
Ensure userspace supplies string not longer than IPSET_MAX_COMMENT_SIZE. Signed-off-by: Sergey Popovich <popovich_sergei@mail.ua> Signed-off-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net/netfilter/ipset/ip_set_list_set.c')
-rw-r--r--net/netfilter/ipset/ip_set_list_set.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/net/netfilter/ipset/ip_set_list_set.c b/net/netfilter/ipset/ip_set_list_set.c
index f8f682806e36..5bd3b1eae3fa 100644
--- a/net/netfilter/ipset/ip_set_list_set.c
+++ b/net/netfilter/ipset/ip_set_list_set.c
@@ -678,7 +678,8 @@ static struct ip_set_type list_set_type __read_mostly = {
[IPSET_ATTR_CADT_FLAGS] = { .type = NLA_U32 },
[IPSET_ATTR_BYTES] = { .type = NLA_U64 },
[IPSET_ATTR_PACKETS] = { .type = NLA_U64 },
- [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING },
+ [IPSET_ATTR_COMMENT] = { .type = NLA_NUL_STRING,
+ .len = IPSET_MAX_COMMENT_SIZE },
[IPSET_ATTR_SKBMARK] = { .type = NLA_U64 },
[IPSET_ATTR_SKBPRIO] = { .type = NLA_U32 },
[IPSET_ATTR_SKBQUEUE] = { .type = NLA_U16 },