[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <Z0CMZcpRfYFuXojU@calendula>
Date: Fri, 22 Nov 2024 14:51:33 +0100
From: Pablo Neira Ayuso <pablo@...filter.org>
To: Florian Westphal <fw@...len.de>
Cc: Pei Xiao <xiaopei01@...inos.cn>, kadlec@...filter.org,
davem@...emloft.net, kuba@...nel.org, pabeni@...hat.com,
horms@...nel.org, netfilter-devel@...r.kernel.org,
netdev@...r.kernel.org, linux-kernel@...r.kernel.org,
syzbot+84d0441b9860f0d63285@...kaller.appspotmail.com,
syzkaller-bugs@...glegroups.com
Subject: Re: [PATCH] netfilter: nf_tables: Use get_cpu_ptr in nft_inner_eval
On Fri, Nov 22, 2024 at 02:45:29PM +0100, Florian Westphal wrote:
> Pei Xiao <xiaopei01@...inos.cn> wrote:
> > syzbot complain about using smp_processor_id in preemptible.
> > use get_cpu_ptr to preempt_disable.
>
> > Reported-by: syzbot+84d0441b9860f0d63285@...kaller.appspotmail.com
> > Closes: https://syzkaller.appspot.com/bug?extid=84d0441b9860f0d63285
> > Fixes: 0e795b37ba04 ("netfilter: nft_inner: add percpu inner context")
> > Signed-off-by: Pei Xiao <xiaopei01@...inos.cn>
> > ---
> > net/netfilter/nft_inner.c | 2 +-
> > 1 file changed, 1 insertion(+), 1 deletion(-)
> >
> > diff --git a/net/netfilter/nft_inner.c b/net/netfilter/nft_inner.c
> > index 928312d01eb1..ae85851bab77 100644
> > --- a/net/netfilter/nft_inner.c
> > +++ b/net/netfilter/nft_inner.c
> > @@ -248,7 +248,7 @@ static bool nft_inner_parse_needed(const struct nft_inner *priv,
> > static void nft_inner_eval(const struct nft_expr *expr, struct nft_regs *regs,
> > const struct nft_pktinfo *pkt)
> > {
> > - struct nft_inner_tun_ctx *tun_ctx = this_cpu_ptr(&nft_pcpu_tun_ctx);
> > + struct nft_inner_tun_ctx *tun_ctx = get_cpu_ptr(&nft_pcpu_tun_ctx);
> > const struct nft_inner *priv = nft_expr_priv(expr);
>
> This can't be right, where is it re-enabled?
>
> Not related to your patch:
> Why is this percpu? How is this softirq safe?
I can add an owner skbuff to nft_inner_tun_ctx area, so this
information can be canceled in case of softirq interference, then
trigger a reparsing of the header.
Powered by blists - more mailing lists