aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPatrick McHardy <kaber@trash.net>2014-01-09 13:42:41 -0500
committerPablo Neira Ayuso <pablo@netfilter.org>2014-01-09 14:17:16 -0500
commit44a6f0df039ee7ddeebc88327dd61f0afb53baa7 (patch)
tree85d4b88176be4fad900c0535fc45a9b87ef07667
parent7047f9d052c379e14b7693bb9f1b766827d0bc40 (diff)
netfilter: nf_tables: prohibit deletion of a table with existing sets
We currently leak the set memory when deleting a table that still has sets in it. Return EBUSY when attempting to delete a table with sets. Signed-off-by: Patrick McHardy <kaber@trash.net> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
-rw-r--r--net/netfilter/nf_tables_api.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/net/netfilter/nf_tables_api.c b/net/netfilter/nf_tables_api.c
index c35261496c30..36add31e08e7 100644
--- a/net/netfilter/nf_tables_api.c
+++ b/net/netfilter/nf_tables_api.c
@@ -467,7 +467,7 @@ static int nf_tables_deltable(struct sock *nlsk, struct sk_buff *skb,
467 if (IS_ERR(table)) 467 if (IS_ERR(table))
468 return PTR_ERR(table); 468 return PTR_ERR(table);
469 469
470 if (table->use) 470 if (!list_empty(&table->chains) || !list_empty(&table->sets))
471 return -EBUSY; 471 return -EBUSY;
472 472
473 list_del(&table->list); 473 list_del(&table->list);