Skip to content

Commit c921ffe

Browse files
Paul Blakeyummakynes
authored andcommitted
netfilter: flowtable: Fix flushing of offloaded flows on free
Freeing a flowtable with offloaded flows, the flow are deleted from hardware but are not deleted from the flow table, leaking them, and leaving their offload bit on. Add a second pass of the disabled gc to delete the these flows from the flow table before freeing it. Fixes: c29f74e ("netfilter: nf_flow_table: hardware offload support") Signed-off-by: Paul Blakey <[email protected]> Signed-off-by: Pablo Neira Ayuso <[email protected]>
1 parent 41e9ec5 commit c921ffe

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

net/netfilter/nf_flow_table_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,9 @@ void nf_flow_table_free(struct nf_flowtable *flow_table)
554554
nf_flow_table_iterate(flow_table, nf_flow_table_do_cleanup, NULL);
555555
nf_flow_table_iterate(flow_table, nf_flow_offload_gc_step, flow_table);
556556
nf_flow_table_offload_flush(flow_table);
557+
if (nf_flowtable_hw_offload(flow_table))
558+
nf_flow_table_iterate(flow_table, nf_flow_offload_gc_step,
559+
flow_table);
557560
rhashtable_destroy(&flow_table->rhashtable);
558561
}
559562
EXPORT_SYMBOL_GPL(nf_flow_table_free);

0 commit comments

Comments
 (0)