Table of Contents

Linux kernel developers are moving to deprecate the AF_ALG cryptographic interface as part of an ongoing effort to reduce kernel attack surface and improve overall system security.

AF_ALG allows userspace applications to access cryptographic algorithms implemented by the Linux kernel. While the interface was originally intended to provide convenient access to kernel crypto services and hardware acceleration features, developers now believe it offers limited practical benefits compared to the security risks and maintenance burden it introduces.

Although AF_ALG remains available in current Linux releases, the deprecation process has begun. Recent patches document its deprecation and remove key features such as zero-copy support and hardware accelerator offloading. These changes are expected to appear in Linux Kernel 7.2.

In this article, we’ll examine why Linux developers want to retire AF_ALG features, and the security concerns driving the decision.

Editor’s note: As of June 2026, Linux 7.1 is in its release-candidate phase (RC6). Linux 7.2 has not been released, and its merge window has not yet opened. The AF_ALG deprecation described in this article is approved and queued in the kernel’s cryptographic subsystem tree, targeting the Linux 7.2 merge window expected to open in mid-June 2026, with Linux 7.2 stable anticipated around late August 2026.

Linux developers increasingly face a difficult challenge: vulnerabilities are being discovered faster than ever. Modern analysis tools, including AI-assisted security research and large language models (LLMs), can help identify bugs and potential attack paths much more quickly than in the past.

During the AF_ALG deprecation discussion, Linux kernel developer Eric Biggers pointed to the changing vulnerability landscape and cited recent examples such as the Copy Fail (CVE-2026-31431) vulnerability. For those unaware, Copy Fail is a logic flaw that allows a 732-byte Python script to gain root access on virtually all major Linux distributions running kernels built since 2017.

Eric argues the modern bug-finding techniques are making large kernel attack surfaces increasingly difficult to justify when they provide limited practical value.

As a result, Linux developers are placing greater emphasis on reducing attack surface wherever possible. AF_ALG was cited as an example of a subsystem whose long-term security costs may outweigh its benefits.

One of the first AF_ALG features targeted for removal is its zero-copy capability.

Zero-copy designs can improve performance by allowing the kernel to operate directly on memory provided by userspace applications instead of creating intermediate copies. However, this approach also creates security challenges.

For those wondering, AF_ALG’s zero-copy implementation allows userspace to request cryptographic operations directly on page cache pages and makes it possible for memory to be modified while cryptographic operations are still in progress. This creates conditions that can lead to time-of-check-to-time-of-use (TOCTOU) vulnerabilities.

The concern is particularly serious because AF_ALG can operate on file-backed memory mappings. In some scenarios, this could allow an attacker to target sensitive files such as the su binary while cryptographic operations are underway.

To reduce this risk, developers are removing AF_ALG’s zero-copy support and replacing it with safer internal kernel copies of the supplied data.

Another proposed change involves hardware crypto acceleration.

AF_ALG was originally intended to provide access to specialized cryptographic accelerator hardware through the kernel crypto subsystem. In practice, however, developers found that these accelerator drivers add complexity, increase maintenance costs, and introduce additional security risks.

They also noted that AF_ALG is not an especially efficient interface for hardware accelerators, and that such usage turned out to be relatively uncommon in real-world deployments.

As a result, AF_ALG support for cryptographic accelerator offloading is being removed as part of the broader deprecation effort.

For most applications, userspace cryptographic libraries such as OpenSSL and similar projects already provide mature, well-maintained implementations of common cryptographic algorithms.

Using userspace libraries avoids exposing additional kernel attack surface while simplifying development and maintenance. This aligns with a long-standing Linux design principle: functionality that does not need to run in the kernel should remain in userspace whenever possible.

Developers noted that relatively few applications still depend on AF_ALG. One example mentioned during the discussion is iwd, the Intel wireless daemon. Developers are encouraged to migrate remaining AF_ALG users to userspace cryptographic libraries where practical.

For most Linux users, the AF_ALG deprecation itself requires no immediate action. The interface remains available in current releases and the full removal will take place over future kernel versions.

However, page cache vulnerabilities like Copy Fail require urgent attention. All users should apply their distribution’s kernel update as soon as possible to protect from these vulnerabilities.

Beyond applying the latest kernel patches, developers and system administrators should begin evaluating whether their software depends on AF_ALG and consider migrating to userspace cryptographic libraries ahead of the eventual removal.

Specific steps to take:

The proposed AF_ALG deprecation reflects a broader trend in Linux kernel development: reducing complexity and removing features that create security risks without providing sufficient real-world benefits.

By eliminating zero-copy support, removing hardware offload functionality, and encouraging migration toward userspace cryptographic libraries, Linux Kernel developers aim to shrink the kernel’s attack surface and reduce future security risks.

AF_ALG is not gone yet, but the kernel maintainers are planning to deprecate it. Developers believe its long-term costs outweigh its benefits, and the deprecation process is now underway.

References:

Senthilkumar Palani (aka SK) is the Founder and Editor in chief of OSTechNix. He is a Linux/Unix enthusiast and FOSS supporter. He lives in Tamilnadu, India.

Save my name, email, and website in this browser for the next time I comment.

Δdocument.getElementById(“ak_js_1”).setAttribute(“value”,(new Date()).getTime())

This site uses Akismet to reduce spam. Learn how your comment data is processed.

About The Author

By admin

Leave a Reply

Your email address will not be published. Required fields are marked *