Cryptsetup 2.8.7 Adapts to the Retirement of AF_ALG in the Linux Kernel

Translated by a model; the original is in Russian.

· Linux and open source
The cryptsetup developers have released an update that teaches the utility to work without the AF_ALG interface — one the kernel came to regard as too large a security hole and began phasing out.

cover.svg

Version 2.8.7 of cryptsetup — the utility responsible for setting up and managing encrypted drives on Linux — has been released. The main goal of this release is to survive the gradual disappearance of the AF_ALG interface, which cryptsetup has long relied on.

Why AF_ALG Is Going Away

AF_ALG gave userspace applications direct access to the kernel's internal cryptographic API. The kernel maintainers, however, came to see this interface as the source of a “huge attack surface”: it was deprecated in Linux 7.2, and Linux 7.3 adds a new sysctl setting that allows its use to be further restricted. For programs like cryptsetup, which have relied on AF_ALG for years, this creates obvious difficulties.

What Changes in libcryptsetup

The libcryptsetup library uses userspace (primarily through AF_ALG) to handle LUKS key slots and to work with on-disk metadata. AF_ALG was convenient because it guaranteed the same set of algorithms both in userspace and, later, in the kernel when a device is activated.

Now the library can take several paths: it can employ a userspace crypto library, use AF_ALG when it is available, and in certain cases (LUKS key slots) resort to a temporary dm-crypt mapping. The last option requires root privileges. This scheme allows most operations to keep working even when AF_ALG is disabled or restricted.

The transition will not be entirely painless. If a required algorithm or encryption mode is not implemented in the userspace library, serious compatibility problems are possible. A telling example is the Adiantum cipher, which exists only in the kernel. The Serpent and Twofish ciphers in XTS mode are also missing from a number of userspace libraries. In addition, when AF_ALG is unavailable, cryptsetup's built-in cipher benchmark stops working.

Other Changes

Beyond adapting to the departure of AF_ALG, version 2.8.7 brings changes to keyring handling, safeguards against possible LUKS volume key digest collisions, support for the Aria and Camellia ciphers in the libgcrypt backend, and a number of other fixes.

You can download cryptsetup 2.8.7 from GitLab.


Source: Phoronix

Comments

Sign in, to comment.

  • No comments yet.