From: "Jason A. Donenfeld" <Jason@zx2c4.com>
To: Amit Klein <aksecurity@gmail.com>
Cc: Yonghong Song <yhs@meta.com>,
david.keisarschm@mail.huji.ac.il,
Alexei Starovoitov <ast@kernel.org>,
Daniel Borkmann <daniel@iogearbox.net>,
John Fastabend <john.fastabend@gmail.com>,
Andrii Nakryiko <andrii@kernel.org>,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>, Yonghong Song <yhs@fb.com>,
KP Singh <kpsingh@kernel.org>,
Stanislav Fomichev <sdf@google.com>, Hao Luo <haoluo@google.com>,
Jiri Olsa <jolsa@kernel.org>,
"David S. Miller" <davem@davemloft.net>,
Eric Dumazet <edumazet@google.com>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
ilay.bahat1@gmail.com, bpf@vger.kernel.org,
linux-kernel@vger.kernel.org, netdev@vger.kernel.org
Subject: Re: [PATCH 2/5] Replace invocation of weak PRNG in kernel/bpf/core.c
Date: Mon, 12 Dec 2022 15:41:15 -0700 [thread overview]
Message-ID: <Y5euC6+f5604XT1y@zx2c4.com> (raw)
In-Reply-To: <CANEQ_+KDR+kC=hYhTtNeQuSTp+-Dg0tRx-9MzJKQ2zH++fBGyQ@mail.gmail.com>
On Tue, Dec 13, 2022 at 12:35:24AM +0200, Amit Klein wrote:
> On Mon, Dec 12, 2022 at 8:03 PM Yonghong Song <yhs@meta.com> wrote:
> >
> >
> >
> > On 12/11/22 2:16 PM, david.keisarschm@mail.huji.ac.il wrote:
> > > From: David <david.keisarschm@mail.huji.ac.il>
> > >
> > > We changed the invocation of
> > > prandom_u32_state to get_random_u32.
> > > We deleted the maintained state,
> > > which was a CPU-variable,
> > > since get_random_u32 maintains its own CPU-variable.
> > > We also deleted the state initializer,
> > > since it is not needed anymore.
> > >
> > > Signed-off-by: David <david.keisarschm@mail.huji.ac.il>
> > > ---
> > > include/linux/bpf.h | 1 -
> > > kernel/bpf/core.c | 13 +------------
> > > kernel/bpf/verifier.c | 2 --
> > > net/core/filter.c | 1 -
> > > 4 files changed, 1 insertion(+), 16 deletions(-)
> > >
> > > diff --git a/include/linux/bpf.h b/include/linux/bpf.h
> [...]
> > Please see the discussion here.
> > https://lore.kernel.org/bpf/87edtctz8t.fsf@toke.dk/
> > There is a performance concern with the above change.
> >
>
> I see. How about using (in this instance only!) the SipHash-based
> solution which was the basis for prandom_u32() starting with commit
> c51f8f88d705 (v5.10-rc1) up until commit d4150779e60f (v5.19-rc1)?
Stop with this pseudo cryptographic garbage. Stop pushing this
everywhere. It was a hassle to undo this crap the first time around. The
last thing we need is to add it back.
Plus, there's no need for it either. I'll revisit the bpf patch if/when
it makes sense to do performance-wise.
Jason
prev parent reply other threads:[~2022-12-12 22:41 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <cover.1670778651.git.david.keisarschm@mail.huji.ac.il>
2022-12-11 22:16 ` [PATCH 1/5] Renaming weak prng invocations - prandom_bytes_state, prandom_u32_state david.keisarschm
2022-12-12 8:35 ` Andy Shevchenko
2022-12-12 14:35 ` Jason A. Donenfeld
2022-12-14 12:33 ` Stanislaw Gruszka
2022-12-14 15:15 ` Eric Dumazet
2022-12-14 15:53 ` Andy Shevchenko
2022-12-14 15:57 ` Andy Shevchenko
2022-12-14 16:21 ` Stanislaw Gruszka
2022-12-14 18:28 ` Theodore Ts'o
2022-12-11 22:16 ` [PATCH 2/5] Replace invocation of weak PRNG in kernel/bpf/core.c david.keisarschm
2022-12-12 18:03 ` Yonghong Song
2022-12-12 22:35 ` Amit Klein
2022-12-12 22:41 ` Jason A. Donenfeld [this message]
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=Y5euC6+f5604XT1y@zx2c4.com \
--to=jason@zx2c4.com \
--cc=aksecurity@gmail.com \
--cc=andrii@kernel.org \
--cc=ast@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=davem@davemloft.net \
--cc=david.keisarschm@mail.huji.ac.il \
--cc=edumazet@google.com \
--cc=haoluo@google.com \
--cc=ilay.bahat1@gmail.com \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kpsingh@kernel.org \
--cc=kuba@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=sdf@google.com \
--cc=song@kernel.org \
--cc=yhs@fb.com \
--cc=yhs@meta.com \
/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).