Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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>

authored by

Patrick McHardy and committed by
Pablo Neira Ayuso
44a6f0df 7047f9d0

+1 -1
+1 -1
net/netfilter/nf_tables_api.c
··· 467 467 if (IS_ERR(table)) 468 468 return PTR_ERR(table); 469 469 470 - if (table->use) 470 + if (!list_empty(&table->chains) || !list_empty(&table->sets)) 471 471 return -EBUSY; 472 472 473 473 list_del(&table->list);