Skip to content

Commit 7005a1f

Browse files
author
Herton R. Krzesinski
committed
Merge: netfilter: flowtable_offload: fix using __this_cpu_add in preemptible
MR: https://gitlab.com/redhat/centos-stream/src/kernel/centos-stream-9/-/merge_requests/2024 Bugzilla: https://bugzilla.redhat.com/2167375 commit a810471 Author: Xin Long <lucien.xin@gmail.com> Date: Thu Nov 24 12:54:10 2022 -0500 netfilter: flowtable_offload: fix using __this_cpu_add in preemptible flow_offload_queue_work() can be called in workqueue without bh disabled, like the call trace showed in my act_ct testing, calling NF_FLOW_TABLE_STAT_INC() there would cause a call trace: BUG: using __this_cpu_add() in preemptible [00000000] code: kworker/u4:0/138560 caller is flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] Workqueue: act_ct_workqueue tcf_ct_flow_table_cleanup_work [act_ct] Call Trace: <TASK> dump_stack_lvl+0x33/0x46 check_preemption_disabled+0xc3/0xf0 flow_offload_queue_work+0xec/0x1b0 [nf_flow_table] nf_flow_table_iterate+0x138/0x170 [nf_flow_table] nf_flow_table_free+0x140/0x1a0 [nf_flow_table] tcf_ct_flow_table_cleanup_work+0x2f/0x2b0 [act_ct] process_one_work+0x6a3/0x1030 worker_thread+0x8a/0xdf0 This patch fixes it by using NF_FLOW_TABLE_STAT_INC_ATOMIC() instead in flow_offload_queue_work(). Note that for FLOW_CLS_REPLACE branch in flow_offload_queue_work(), it may not be called in preemptible path, but it's good to use NF_FLOW_TABLE_STAT_INC_ATOMIC() for all cases in flow_offload_queue_work(). Fixes: b038177 ("netfilter: nf_flow_table: count pending offload workqueue tasks") Signed-off-by: Xin Long <lucien.xin@gmail.com> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org> Signed-off-by: Luis Claudio R. Goncalves <lgoncalv@redhat.com> Approved-by: Florian Westphal <fwestpha@redhat.com> Approved-by: Valentin Schneider <vschneid@redhat.com> Approved-by: Derek Barbosa <debarbos@redhat.com> Signed-off-by: Herton R. Krzesinski <herton@redhat.com>
2 parents c9cbfbd + 91d79aa commit 7005a1f

File tree

0 file changed

+0
-0
lines changed

    0 file changed

    +0
    -0
    lines changed

    0 commit comments

    Comments
     (0)