Linux cryptographic layer development
 help / color / mirror / Atom feed
From: Eric Biggers <ebiggers@kernel.org>
To: Karl Mehltretter <kmehltretter@gmail.com>
Cc: bpf@vger.kernel.org, Vadim Fedorenko <vadim.fedorenko@linux.dev>,
	Alexei Starovoitov <ast@kernel.org>,
	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>
Subject: Re: [PATCH bpf-next] bpf: crypto: Use AES-CBC and AES-ECB libraries
Date: Mon, 31 Aug 2026 14:48:18 -0700	[thread overview]
Message-ID: <20260831214818.GF86114@quark> (raw)
In-Reply-To: <apXwXLRpBUIWQuC5@gmail.com>

On Mon, Aug 31, 2026 at 11:25:54PM +0200, Karl Mehltretter wrote:
> On Mon, Aug 31, 2026 at 12:21:39PM +0100, Eric Biggers wrote:
> > There are library APIs for both of these now, which are much easier to
> > use and more efficient.  Reimplement BPF crypto on top of them, greatly
> > simplifying the code.  As part of this, the bpf_crypto_type abstraction
> > layer is removed, as it's not useful.
> > 
> 
> This relates to my recent patch fixing state preservation in lskcipher's
> unaligned path, which exercised ARC4 through BPF:
> 
> https://lore.kernel.org/r/20260829194314.42685-1-kmehltretter@gmail.com
> 
> While looking at your patch, I tested the actual BPF-visible algorithm
> surface. The ECB and CBC templates allow considerably more than AES.

Right, apparently any "crypto_cipher" can be composed with "ecb" or
"cbc" as an "lskcipher".  I think in this case it's only of theoretical
interest and is a bug, not a feature, though.  Especially given the
presence of ARC4, DES, TEA, etc. on that list.

We see this a lot with the "Crypto API", where a new kernel feature
actually uses one or two algorithms, then unnecessarily allows every
single algorithm to be theoretically reachable (including insecure,
obsolete, or nonsense options) just because the API takes a string.

- Eric

      reply	other threads:[~2026-08-31 21:48 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-08-31 19:21 [PATCH bpf-next] bpf: crypto: Use AES-CBC and AES-ECB libraries Eric Biggers
2026-08-31 20:29 ` bot+bpf-ci
2026-08-31 21:59   ` Eric Biggers
2026-08-31 22:43     ` Eric Biggers
2026-08-31 21:25 ` Karl Mehltretter
2026-08-31 21:48   ` Eric Biggers [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=20260831214818.GF86114@quark \
    --to=ebiggers@kernel.org \
    --cc=andrii@kernel.org \
    --cc=ast@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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox