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>
This commit is contained in:
Patrick McHardy 2014-01-09 18:42:41 +00:00 коммит произвёл Pablo Neira Ayuso
Родитель 7047f9d052
Коммит 44a6f0df03
1 изменённых файлов: 1 добавлений и 1 удалений

Просмотреть файл

@ -467,7 +467,7 @@ static int nf_tables_deltable(struct sock *nlsk, struct sk_buff *skb,
if (IS_ERR(table))
return PTR_ERR(table);
if (table->use)
if (!list_empty(&table->chains) || !list_empty(&table->sets))
return -EBUSY;
list_del(&table->list);