netfilter: xt_cpu: prefer raw_smp_processor_id
With PREEMPT_RCU we get splat: BUG: using smp_processor_id() in preemptible [..] caller is cpu_mt+0x53/0xd0 net/netfilter/xt_cpu.c:37 CPU: 1 .. Comm: syz.3.1377 #0 PREEMPT(full) Call Trace: <TASK> dump_stack_lvl+0xe8/0x150 lib/dump_stack.c:120 check_preemption_disabled+0xd3/0xe0 lib/smp_processor_id.c:47 cpu_mt+0x53/0xd0 net/netfilter/xt_cpu.c:37 [..] Just use raw version instead. This is similar to14d14a5d29("netfilter: nft_meta: use raw_smp_processor_id()"). Fixes:0ca743a559("netfilter: nf_tables: add compatibility layer for x_tables") Reported-by: syzbot+690d3e3ffa7335ac10eb@syzkaller.appspotmail.com Signed-off-by: Florian Westphal <fw@strlen.de>
This commit is contained in:
1 parent
47980b6dbf
commit
c376f07e16
1 file changed
+1
-1
@@ -34,7 +34,7 @@ static bool cpu_mt(const struct sk_buff *skb, struct xt_action_param *par)
|
||||
{
|
||||
const struct xt_cpu_info *info = par->matchinfo;
|
||||
|
||||
return (info->cpu == smp_processor_id()) ^ info->invert;
|
||||
return (info->cpu == raw_smp_processor_id()) ^ info->invert;
|
||||
}
|
||||
|
||||
static struct xt_match cpu_mt_reg __read_mostly = {
|
||||
|
||||
Reference in new issue
Block a user