News for hackers. Stuff that matters.
Re:Copy Fail – CVE-2026-31431 by still_grokking on Wednesday April 29, 2026 @08:40PM (#47956609)
As I did not know what AF_ALG is in the first place I've searched for it and found this here:

https://www.chronox.de/libkcapi/html/ch01s02.html

It states the following:

> There are several reasons for AF_ALG:

> * The first and most important item is the access to hardware accelerators and hardware devices whose technical interface can only be accessed from the kernel mode / supervisor state of the processor. Such support cannot be used from user space except through AF_ALG.

> * When using user space libraries, all key material and other cryptographic sensitive parameters remains in the calling application's memory even when the application supplied the information to the library. When using AF_ALG, the key material and other sensitive parameters are handed to the kernel. The calling application now can reliably erase that information from its memory and just use the cipher handle to perform the cryptographic operations. If the application is cracked an attacker cannot obtain the key material.

> * On memory constrained systems like embedded systems, the additional memory footprint of a user space cryptographic library may be too much. As the kernel requires the kernel crypto API to be present, reusing existing code should reduce the memory footprint.

I can't judge whether this is a good justification, but there is one.

Re:Copy Fail – CVE-2026-31431 by buckle8017 on Wednesday April 29, 2026 @09:54PM (#47957158)
You should take note that this is written by the person that wrote the bad patch.

So grain of salt.

Re:Copy Fail – CVE-2026-31431 by asveikau on Wednesday April 29, 2026 @11:50PM (#47957870)
I feel like it should be possible to fulfill these advantages with a minimal, not very complex API. I.e. the grandparent's comment about IPsec implementation details doesn't make the cut, but a hardware accelerated cipher implementation does.
Re:Copy Fail – CVE-2026-31431 by amluto on Friday May 01, 2026 @11:08AM (#47975696)
A hardware accelerated DMA-capable cipher implementation is an odd thing, and it’s generally not useful on its own. You might want to set up a whole chain of operations (encrypt, checksum, send to network, for example), but I’ve never encountered a case where you actually want to ask an accelerator to asynchronously encrypt application data and return the encrypted data to the application.
Re:Copy Fail – CVE-2026-31431 by hansvm on Monday May 04, 2026 @08:58PM (#48016805)
Unless you're pushing a ton of extra work into a network-capable accelerator, that sounds exactly like what you'd want for, e.g., an encrypted S3 implementation. You have encryption, RS encoding, striped checksumming, sending fragments to multiple hosts, some sort of potentially interesting partial failure handling, etc.

You could push that all down to the accelerator, but if there are even a few such use cases you might want a dedicated DMA-capable implementation instead.

Re:Copy Fail – CVE-2026-31431 by still_grokking on Wednesday April 29, 2026 @10:01PM (#47957210)
I've said I'm not sure about the validity of that reasoning.

I've liked it nevertheless for context, as augmentation to parent's post.

Re:Copy Fail – CVE-2026-31431 by mihaaly on Thursday April 30, 2026 @04:52AM (#47959886)
But is it true or not? Whoever wrote it. (for objective truth the subjects are unimportant)
Re:Copy Fail – CVE-2026-31431 by skywhopper on Thursday April 30, 2026 @05:24AM (#47960077)
When you can’t know the objective truth or when there isn’t one (as is the case in making decisions about security tradeoffs in software design), knowing the source of the argument is vital to interpreting its validity.
Re:Copy Fail – CVE-2026-31431 by bawolff on Thursday April 30, 2026 @08:47AM (#47961608)
I disagree 100%. Software security tradeoffs are definitely the sort of thing where you can evaluate arguments on their merits.
Re:Copy Fail – CVE-2026-31431 by buckle8017 on Thursday April 30, 2026 @08:22AM (#47961359)
It might have been true in 2002 but it hasn't been true since at least about 2010.

You've almost certainly never had a system that supported any hardware accelerated crypto that also required a kernel module.

It's much easier to expose as cpu extensions.

Re:Copy Fail – CVE-2026-31431 by p_l on Thursday April 30, 2026 @03:12AM (#47959241)
AF_ALG if I remember correctly predates userspace-accessible crypto acceleration and was way more important back when it meant you had actual need for "SSL accelerator" cards in servers, among other things
Re:Copy Fail – CVE-2026-31431 by neuroelectron on Friday May 01, 2026 @12:06PM (#47976389)
Yes, I remember that time, it was back when I wasn't allowed to know anything about what servers were doing other than to look it up in the internal leak, which was never maintained
Re:Copy Fail – CVE-2026-31431 by neuroelectron on Friday May 01, 2026 @05:18PM (#47980465)
*intenral wiki
Re:Copy Fail – CVE-2026-31431 by ryukoposting on Thursday April 30, 2026 @06:33AM (#47960523)
Hi, embedded firmware engineer here. I give it a B-

There's a weird area between the workloads that fit on a microcontroller, and the stuff that demands a full-blown CPU. Think softcore processors on FPGAs, super tiny MIPS and RISC-V cores on an ASIC, etc. Typically you run something like Yocto on a core like that. Maybe MontaVista or QNX if you've got the right nerd running the show.

So you have serious compute needs, and security concerns that justify virtual memory. But you don't have infinite space to work with, so hardware acceleration is important. Having a standard API built into the kernel seems like a decent idea I guess.

And yet, I've never heard of AF_ALG. I've never seen it used. The thing is, if you have some bizzaro softcore, there's a good chance you also have a bizzaro crypto engine with no upstream kernel driver. If you're going to the trouble of rolling your own kernel with drivers for special crypto engines, why would you bother hooking it into this thing? Roll your own API that fits your needs and doesn't have a gigantic attack surface.

Re:Copy Fail – CVE-2026-31431 by rcxdude on Tuesday May 05, 2026 @08:55AM (#48021888)
This suggests that it is useful in some niche embedded use- cases, but should probably not be enabled by default on most desktop/server kennels