From: sashiko-bot@kernel.org
To: "Eric Biggers" <ebiggers@kernel.org>
Cc: bpf@vger.kernel.org
Subject: Re: [PATCH bpf-next v3] bpf: crypto: Use AES-CBC and AES-ECB libraries
Date: Tue, 22 Sep 2026 04:16:09 +0000 [thread overview]
Message-ID: <20260922041609.CE4BB1F000FF@smtp.kernel.org> (raw)
In-Reply-To: <20260922040413.28885-1-ebiggers@kernel.org>
Thank you for your contribution! Sashiko AI review found 1 potential issue(s) to consider:
- [High] bpf: BPF_CRYPTO is silently disabled on modular kernels
--
commit 4eaa15850cd54db254c7280e28e3b2a751a2c186
Author: Eric Biggers <ebiggers@kernel.org>
bpf: crypto: Use AES-CBC and AES-ECB libraries
This commit reimplements BPF crypto kfuncs to use the AES-CBC and AES-ECB
library APIs instead of the lskcipher API. It removes the bpf_crypto_type
abstraction layer and simplifies the crypto implementation.
Link: https://lore.kernel.org/r/d1cdfc23-b336-49a9-8833-29f05b5b9fec@linux.dev/
Link: https://lore.kernel.org/r/5f9c3aab-5339-463c-a86d-edac297e1e95@linux.dev/
> diff --git a/kernel/bpf/Kconfig b/kernel/bpf/Kconfig
> index d7d25477ef481..a44ecfa3e9ef5 100644
> --- a/kernel/bpf/Kconfig
> +++ b/kernel/bpf/Kconfig
> @@ -91,6 +91,15 @@ config BPF_UNPRIV_DEFAULT_OFF
>
> If you are unsure how to answer this question, answer Y.
>
> +config BPF_CRYPTO
> + def_bool y
> + depends on BPF_SYSCALL
> + depends on CRYPTO_LIB_AES_CBC
> + depends on CRYPTO_LIB_AES_ECB
[Severity: High]
Will this silently disable BPF_CRYPTO on modular kernels?
In kernel/bpf/Kconfig, BPF_CRYPTO is defined as a boolean symbol. If the
kernel is configured with CONFIG_CRYPTO_AES=m (which is common for many
distribution kernels), the hidden library symbols CRYPTO_LIB_AES_CBC and
CRYPTO_LIB_AES_ECB evaluate to 'm'.
Because a 'bool' config cannot be set to 'm', the 'depends on' directives
here will force BPF_CRYPTO to evaluate to 'n', completely disabling it.
Furthermore, because BPF_CRYPTO lacks a prompt string, users cannot see
why it was disabled or enable it manually.
This causes the BPF crypto kfuncs to be silently omitted from the build,
which would cause programs relying on them to fail to load.
Would it be better to conditionally select these libraries or find another
way to express this requirement to ensure BPF_CRYPTO remains enabled?
> + help
> + Provide the kfuncs needed for BPF programs to encrypt and decrypt
> + data. The supported algorithms are AES-CBC and AES-ECB.
> +
> source "kernel/bpf/preload/Kconfig"
--
Sashiko AI review · https://sashiko.dev/#/patchset/20260922040413.28885-1-ebiggers@kernel.org?part=1
next prev parent reply other threads:[~2026-09-22 4:16 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 [this message]
2026-09-22 4:48 ` Alexei Starovoitov
2026-09-22 5:07 ` Eric Biggers
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=20260922041609.CE4BB1F000FF@smtp.kernel.org \
--to=sashiko-bot@kernel.org \
--cc=bpf@vger.kernel.org \
--cc=ebiggers@kernel.org \
--cc=sashiko-reviews@lists.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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox