public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Demi Marie Obenour <demiobenour@gmail.com>
To: Eric Biggers <ebiggers@kernel.org>
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: Mon, 4 May 2026 02:59:41 -0400	[thread overview]
Message-ID: <75cfc88d-31ff-4412-8c5f-788032498579@gmail.com> (raw)
In-Reply-To: <20260504065655.GB112568@sol>


[-- Attachment #1.1.1: Type: text/plain, Size: 2268 bytes --]

On 5/4/26 02:56, Eric Biggers wrote:
> 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

Should this also link to copy.fail or a related email?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

[-- Attachment #2: OpenPGP digital signature --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

  reply	other threads:[~2026-05-04  6:59 UTC|newest]

Thread overview: 12+ 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
2026-05-04  6:59     ` Demi Marie Obenour [this message]
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-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=75cfc88d-31ff-4412-8c5f-788032498579@gmail.com \
    --to=demiobenour@gmail.com \
    --cc=0wn@theori.io \
    --cc=bpak@theori.io \
    --cc=ebiggers@kernel.org \
    --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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox