Skip to content

Commit

Permalink
netfilter: nf_tables: prohibit deletion of a table with existing sets
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Pablo Neira Ayuso <[email protected]>
  • Loading branch information
kaber authored and ummakynes committed Jan 9, 2014
1 parent 7047f9d commit 44a6f0d
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion net/netfilter/nf_tables_api.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit 44a6f0d

Please sign in to comment.