aboutsummaryrefslogtreecommitdiffstats
path: root/net
diff options
context:
space:
mode:
authorTomasz Bursztyka <tomasz.bursztyka@linux.intel.com>2012-06-27 22:57:48 -0400
committerPablo Neira Ayuso <pablo@netfilter.org>2012-06-29 07:04:04 -0400
commitd31f4d448f7671dc3e6a7a1c92a4c085a36058bb (patch)
treefafed9f713c18c573c499c45fb1461ee49f24516 /net
parenta2da399823ccb0f4ddf83700bf297803e5320f7e (diff)
netfilter: ipset: fix crash if IPSET_CMD_NONE command is sent
This patch fixes a crash if that ipset command is sent over nfnetlink. Signed-off-by: Tomasz Bursztyka <tomasz.bursztyka@linux.intel.com> Acked-by: Jozsef Kadlecsik <kadlec@blackhole.kfki.hu> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
Diffstat (limited to 'net')
-rw-r--r--net/netfilter/ipset/ip_set_core.c12
1 files changed, 12 insertions, 0 deletions
diff --git a/net/netfilter/ipset/ip_set_core.c b/net/netfilter/ipset/ip_set_core.c
index 819c342f5b30..9730882697aa 100644
--- a/net/netfilter/ipset/ip_set_core.c
+++ b/net/netfilter/ipset/ip_set_core.c
@@ -640,6 +640,14 @@ find_free_id(const char *name, ip_set_id_t *index, struct ip_set **set)
640} 640}
641 641
642static int 642static int
643ip_set_none(struct sock *ctnl, struct sk_buff *skb,
644 const struct nlmsghdr *nlh,
645 const struct nlattr * const attr[])
646{
647 return -EOPNOTSUPP;
648}
649
650static int
643ip_set_create(struct sock *ctnl, struct sk_buff *skb, 651ip_set_create(struct sock *ctnl, struct sk_buff *skb,
644 const struct nlmsghdr *nlh, 652 const struct nlmsghdr *nlh,
645 const struct nlattr * const attr[]) 653 const struct nlattr * const attr[])
@@ -1539,6 +1547,10 @@ nlmsg_failure:
1539} 1547}
1540 1548
1541static const struct nfnl_callback ip_set_netlink_subsys_cb[IPSET_MSG_MAX] = { 1549static const struct nfnl_callback ip_set_netlink_subsys_cb[IPSET_MSG_MAX] = {
1550 [IPSET_CMD_NONE] = {
1551 .call = ip_set_none,
1552 .attr_count = IPSET_ATTR_CMD_MAX,
1553 },
1542 [IPSET_CMD_CREATE] = { 1554 [IPSET_CMD_CREATE] = {
1543 .call = ip_set_create, 1555 .call = ip_set_create,
1544 .attr_count = IPSET_ATTR_CMD_MAX, 1556 .attr_count = IPSET_ATTR_CMD_MAX,