Skip to content

Commit

Permalink
Merge tag 'nf-25-04-17' of git://git.kernel.org/pub/scm/linux/kernel/…
Browse files Browse the repository at this point in the history
…git/netfilter/nf

Pablo Neira Ayuso says:

====================
Netfilter fix for net

The following batch contains one Netfilter fix for net:

1) conntrack offload bit is erroneously unset in a race scenario,
   from Florian Westphal.

netfilter pull request 25-04-17

* tag 'nf-25-04-17' of git://git.kernel.org/pub/scm/linux/kernel/git/netfilter/nf:
  netfilter: conntrack: fix erronous removal of offload bit
====================

Link: https://patch.msgid.link/20250417102847.16640-1-pablo@netfilter.org
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
  • Loading branch information
Paolo Abeni committed Apr 17, 2025
2 parents a43ae7c + d2d31ea commit 8e57ce3
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions net/netfilter/nf_flow_table_core.c
Original file line number Diff line number Diff line change
Expand Up @@ -383,8 +383,8 @@ static void flow_offload_del(struct nf_flowtable *flow_table,
void flow_offload_teardown(struct flow_offload *flow)
{
clear_bit(IPS_OFFLOAD_BIT, &flow->ct->status);
set_bit(NF_FLOW_TEARDOWN, &flow->flags);
flow_offload_fixup_ct(flow);
if (!test_and_set_bit(NF_FLOW_TEARDOWN, &flow->flags))
flow_offload_fixup_ct(flow);
}
EXPORT_SYMBOL_GPL(flow_offload_teardown);

Expand Down Expand Up @@ -558,10 +558,12 @@ static void nf_flow_offload_gc_step(struct nf_flowtable *flow_table,

if (nf_flow_has_expired(flow) ||
nf_ct_is_dying(flow->ct) ||
nf_flow_custom_gc(flow_table, flow))
nf_flow_custom_gc(flow_table, flow)) {
flow_offload_teardown(flow);
else if (!teardown)
teardown = true;
} else if (!teardown) {
nf_flow_table_extend_ct_timeout(flow->ct);
}

if (teardown) {
if (test_bit(NF_FLOW_HW, &flow->flags)) {
Expand Down

0 comments on commit 8e57ce3

Please sign in to comment.