From: Eric Biggers <ebiggers@kernel.org>
To: Alexei Starovoitov <alexei.starovoitov@gmail.com>
Cc: bpf@vger.kernel.org, Vadim Fedorenko <vadim.fedorenko@linux.dev>,
Daniel Borkmann <daniel@iogearbox.net>,
Andrii Nakryiko <andrii@kernel.org>,
Eduard Zingerman <eddyz87@gmail.com>,
Kumar Kartikeya Dwivedi <memxor@gmail.com>,
linux-crypto@vger.kernel.org, linux-kernel@vger.kernel.org,
Martin KaFai Lau <martin.lau@linux.dev>,
Song Liu <song@kernel.org>,
Yonghong Song <yonghong.song@linux.dev>,
Jiri Olsa <jolsa@kernel.org>,
Emil Tsalapatis <emil@etsalapatis.com>,
Ihor Solodrai <ihor.solodrai@linux.dev>,
John Fastabend <john.fastabend@gmail.com>,
Karl Mehltretter <kmehltretter@gmail.com>
Subject: Re: [PATCH bpf-next v3] bpf: crypto: Use AES-CBC and AES-ECB libraries
Date: Mon, 21 Sep 2026 22:07:23 -0700 [thread overview]
Message-ID: <20260922050723.GA14616@sol> (raw)
In-Reply-To: <DLLKN9WTMVHD.1601DUU5LBVAB@gmail.com>
On Tue, Sep 22, 2026 at 04:48:02AM +0000, Alexei Starovoitov wrote:
> On Mon, Sep 21, 2026 at 09:04 PM Eric Biggers <ebiggers@kernel.org> wrote:
> > +config BPF_CRYPTO
> > + def_bool y
> > + depends on BPF_SYSCALL
> > + depends on CRYPTO_LIB_AES_CBC
> > + depends on CRYPTO_LIB_AES_ECB
>
> This will break the build with CRYPTO_AES=m.
No, the new implementation only calls library code. And if that library
code isn't built-in, then this just doesn't get built at all, as per the
'depends on' lines.
I'm not sure what you expected. This could be a tristate, but that
would mean it would be its own module, which doesn't seem conventional
for kfuncs.
> > struct bpf_crypto_ctx {
> > - const struct bpf_crypto_type *type;
> > - void *tfm;
> > - u32 siv_len;
> > + enum bpf_crypto_algo_id algo;
> > + void *key;
>
> No need for this. The bot was wrong.
> Reading any field of struct bpf_crypto_ctx requires CAP_PERFMON.
Okay, it sounded like a weird BPF quirk where the type system was being
used to enforce a security boundary. But if it's not needed, then
that's helpful. I'll go back to the original struct embedding.
- Eric
next prev parent reply other threads:[~2026-09-22 5:07 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-09-22 4:04 [PATCH bpf-next v3] bpf: crypto: Use AES-CBC and AES-ECB libraries Eric Biggers
2026-09-22 4:16 ` sashiko-bot
2026-09-22 4:48 ` Alexei Starovoitov
2026-09-22 5:07 ` Eric Biggers [this message]
2026-09-22 5:15 ` Alexei Starovoitov
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=20260922050723.GA14616@sol \
--to=ebiggers@kernel.org \
--cc=alexei.starovoitov@gmail.com \
--cc=andrii@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=daniel@iogearbox.net \
--cc=eddyz87@gmail.com \
--cc=emil@etsalapatis.com \
--cc=ihor.solodrai@linux.dev \
--cc=john.fastabend@gmail.com \
--cc=jolsa@kernel.org \
--cc=kmehltretter@gmail.com \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=martin.lau@linux.dev \
--cc=memxor@gmail.com \
--cc=song@kernel.org \
--cc=vadim.fedorenko@linux.dev \
--cc=yonghong.song@linux.dev \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.