From: Eric Biggers <ebiggers@kernel.org>
To: Demi Marie Obenour <demiobenour@gmail.com>
Cc: linux-crypto@vger.kernel.org,
Herbert Xu <herbert@gondor.apana.org.au>,
linux-kernel@vger.kernel.org, linux-hardening@vger.kernel.org,
Taeyang Lee <0wn@theori.io>, Brian Pak <bpak@theori.io>,
Juno Im <juno@theori.io>, Jungwon Lim <setuid0@theori.io>,
Tim Becker <tjbecker@theori.io>, Feng Ning <feng@innora.ai>,
stable@vger.kernel.org
Subject: Re: [PATCH] crypto: af_alg - Remove zero-copy support from AF_ALG
Date: Sun, 3 May 2026 23:56:55 -0700 [thread overview]
Message-ID: <20260504065655.GB112568@sol> (raw)
In-Reply-To: <79b24e6f-91a2-4dd0-a5f2-c01a9247ea9c@gmail.com>
On Mon, May 04, 2026 at 02:54:27AM -0400, Demi Marie Obenour wrote:
> On 5/4/26 02:15, Eric Biggers wrote:
> > The zero-copy support is one of the riskiest aspects of AF_ALG. It
> > allows userspace to request cryptographic operations directly on
> > pagecache pages of files like the 'su' binary. It also allows userspace
> > to concurrently modify the memory which is being operated on, a huge
> > recipe for TOCTOU vulnerabilities.
> >
> > While zero-copy support is more valuable in other areas of the kernel
> > like the frequently used networking and file I/O code, it has far less
> > value in AF_ALG, which is a niche UAPI. AF_ALG primarily just exists
> > for backwards compatibility with a small set of userspace programs such
> > as 'iwd' that haven't yet been fixed to use userspace crypto code.
> >
> > Originally AF_ALG was intended to be used to access hardware crypto
> > accelerators. However, it isn't an efficient interface for that anyway,
> > and it turned out to be rarely used in this way in practice.
> >
> > Thus, the risks of the zero-copy support in AF_ALG vastly outweigh its
> > benefits. Just remove it.
> >
> > Note that this isn't a hard break, since the splice syscall is still
> > supported. The data is just now copied instead. So it still works,
> > just a bit slower in some cases.
> >
> > Tested with libkcapi/test.sh. All its test cases still pass. I also
> > verified that this would have prevented the copy.fail exploit as well.
> >
> > Fixes: 8ff590903d5f ("crypto: algif_skcipher - User-space interface for skcipher operations")
> > Fixes: 400c40cf78da ("crypto: algif - add AEAD support")
> > Reported-by: Taeyang Lee <0wn@theori.io>
> > Reported-by: Feng Ning <feng@innora.ai>
[...]
> In light of https://lore.kernel.org/all/afYcc-tZFwvZZo76@ans-MacBook-Pro.local/,
> yes please!
>
> Should there be a Link: tag referencing that email?
Yes I forgot to put that in, sorry. It should go after the second
Reported-by:
Link: https://lore.kernel.org/r/afYcc-tZFwvZZo76@ans-MacBook-Pro.local
- Eric
next prev parent reply other threads:[~2026-05-04 6:58 UTC|newest]
Thread overview: 13+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-05-04 6:15 [PATCH] crypto: af_alg - Remove zero-copy support from AF_ALG Eric Biggers
2026-05-04 6:54 ` Demi Marie Obenour
2026-05-04 6:56 ` Eric Biggers [this message]
2026-05-04 6:59 ` Demi Marie Obenour
2026-05-04 7:07 ` Eric Biggers
2026-05-04 7:10 ` [PATCH v2] " Eric Biggers
2026-05-04 9:24 ` Eric Biggers
2026-05-04 22:53 ` [PATCH v3] crypto: af_alg - Remove zero-copy support from skcipher and aead Eric Biggers
2026-05-15 10:12 ` Herbert Xu
2026-05-04 16:07 ` [PATCH] crypto: af_alg - Remove zero-copy support from AF_ALG Ⓐlï P☮latel
2026-05-04 17:47 ` Eric Biggers
2026-05-04 18:26 ` Ⓐlï P☮latel
2026-05-04 22:25 ` Eric Biggers
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=20260504065655.GB112568@sol \
--to=ebiggers@kernel.org \
--cc=0wn@theori.io \
--cc=bpak@theori.io \
--cc=demiobenour@gmail.com \
--cc=feng@innora.ai \
--cc=herbert@gondor.apana.org.au \
--cc=juno@theori.io \
--cc=linux-crypto@vger.kernel.org \
--cc=linux-hardening@vger.kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=setuid0@theori.io \
--cc=stable@vger.kernel.org \
--cc=tjbecker@theori.io \
/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.