From: Florian Westphal <fw@strlen.de>
To: Pablo Neira Ayuso <pablo@netfilter.org>
Cc: netfilter-devel@vger.kernel.org, fw@strlen.de, fasnacht@protonmail.ch
Subject: Re: [PATCH nf,v2] netfilter: nf_tables: disable bh to update per-cpu rnd_state
Date: Wed, 18 May 2022 18:46:21 +0200 [thread overview]
Message-ID: <20220518164621.GH4316@breakpoint.cc> (raw)
In-Reply-To: <20220518160022.224294-1-pablo@netfilter.org>
Pablo Neira Ayuso <pablo@netfilter.org> wrote:
> bh might occur while updating per-cpu rnd_state from user context,
> ie. local_out path.
>
> [233241.951068] BUG: using smp_processor_id() in preemptible [00000000] code: nginx/2725
> [233241.951220] caller is nft_ng_random_eval+0x24/0x54 [nft_numgen]
> [233241.951225] CPU: 2 PID: 2725 Comm: nginx Tainted: G OE 5.16.0-0.bpo.4-amd64 #1 Debian 5.16.12-1~bpo11+1
> [233241.951227] Hardware name: Supermicro SYS-5039MC-H8TRF/X11SCD-F, BIOS 1.7 11/23/2021
> [233241.951228] Call Trace:
> [233241.951231] <TASK>
> [233241.951233] dump_stack_lvl+0x48/0x5e
> [233241.951236] check_preemption_disabled+0xde/0xe0
> [233241.951239] nft_ng_random_eval+0x24/0x54 [nft_numgen]
>
> Fixes: 6b2faee0ca91 ("netfilter: nft_meta: place prandom handling in a helper")
> Fixes: 978d8f9055c3 ("netfilter: nft_numgen: add map lookups for numgen random operations")
> Signed-off-by: Pablo Neira Ayuso <pablo@netfilter.org>
> ---
> v2: disable/enable bh
> @Florian: your rand meta support is missing {disable,enable}_local_bh()
I wonder if its better to just switch to get_random_u32() instead of prandom.
next prev parent reply other threads:[~2022-05-18 16:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-05-18 16:00 [PATCH nf,v2] netfilter: nf_tables: disable bh to update per-cpu rnd_state Pablo Neira Ayuso
2022-05-18 16:46 ` Florian Westphal [this message]
2022-05-18 17:51 ` Pablo Neira Ayuso
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20220518164621.GH4316@breakpoint.cc \
--to=fw@strlen.de \
--cc=fasnacht@protonmail.ch \
--cc=netfilter-devel@vger.kernel.org \
--cc=pablo@netfilter.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).