A new local privilege escalation (LPE) vulnerability, tracked as CVE-2026-31431 (dubbed “CopyFail”), has recently surfaced, impacting a wide range of Linux kernels. This vulnerability exploits a logic flaw in the kernel’s crypto subsystem, specifically within the algif_aead interface.
For enterprise Linux distributions like RHEL, AlmaLinux, and CloudLinux, this issue is particularly critical because the vulnerable component is often compiled directly into the kernel image (builtin), rather than being loaded as a discrete, removable module.
Identifying the Risk
First, determine if your kernel includes the affected code by checking your kernel configuration file:
grep CONFIG_CRYPTO_USER_API_AEAD /boot/config-$(uname -r)-
Result
CONFIG_CRYPTO_USER_API_AEAD=m: The component is a module. You can mitigate this by blacklisting the module via/etc/modprobe.d/. -
Result
CONFIG_CRYPTO_USER_API_AEAD=y: The component is built-in. Standard module unloading techniques (rmmod) will fail, and simply blacklisting the module will have no effect.
If your configuration check returns CONFIG_CRYPTO_USER_API_AEAD=m, the component is compiled as a loadable kernel module rather than built-in. In this case, you don’t need to modify your GRUB boot parameters; you can use the standard module blacklisting mechanism.
Mitigating CONFIG_CRYPTO_USER_API_AEAD=m
-
Create a Blacklist Configuration:
Create a configuration file in/etc/modprobe.d/to prevent the kernel from loading the module. This effectively forces the system to run/bin/falseinstead of the actual module initialization.echo "install algif_aead /bin/false" | sudo tee /etc/modprobe.d/disable-algif.conf -
Check if the module is currently loaded:
If the module was already loaded before you created the blacklist file, it will remain in memory until you unload it or reboot.lsmod | grep algif_aead -
Unload the module:
If the module appears in thelsmodoutput, try to unload it manually:sudo rmmod algif_aeadNote: If you receive a “Module is in use” error, a service is currently relying on it. A system reboot is the safest way to ensure the module does not load again.
Why this approach is preferred
When a feature is compiled as a module (=m), modprobe manages its lifecycle. By using the install ... /bin/false directive, you hook into the module loading process directly. This is cleaner than modifying boot arguments and is standard practice for hardening Linux modules.
Crucial reminder: Only use this method if your check returns m. If your output is y (built-in), this configuration will be ignored by the kernel, and you must use the initcall_blacklist method.
On systems where algif_aead is built-in (the default for most RHEL-based kernels), you must prevent the kernel from initializing the vulnerable function during the boot process. You can achieve this by using the initcall_blacklist kernel parameter.
Mitigating CONFIG_CRYPTO_USER_API_AEAD=y
-
Update your GRUB configuration:
Usinggrubbyis the safest way to update your boot parameters without risking syntax errors in the configuration files:sudo grubby --update-kernel=ALL --args="initcall_blacklist=algif_aead_init" -
Verify the change:
Ensure the parameter is present in your boot command line:cat /proc/cmdline -
Reboot and confirm:
After the system reboots, confirm that the kernel ignored the initialization call:sudo dmesg | grep -i algif_aeadIf successful, you will see output confirming that
algif_aead_inithas been blacklisted.
Important Considerations
-
This is a temporary measure:
initcall_blacklistis a surgical mitigation. It is not a permanent patch. Ensure you regularly check for official kernel updates from your distribution (AlmaLinux, CloudLinux, or Red Hat) and apply them as soon as they are available. -
Reverting the mitigation: Once you have updated to a patched kernel version, verify your kernel version and remove the parameter to restore standard system behavior:
sudo grubby --update-kernel=ALL --remove-args="initcall_blacklist=algif_aead_init"
Stay vigilant, keep your kernels updated, and remember: while workarounds are essential for immediate defense, timely package management remains the gold standard for security.
Another Important Note for Security Researchers
If you are testing the CopyFail (CVE-2026-31431) exploit on your own infrastructure to verify vulnerability or test your patch, it is crucial to understand that the exploit works by modifying the page cache rather than the physical binary on disk.
Because the kernel retains the modified version in memory, even if you successfully patch the system or remove the exploit binary, the compromised page cache may persist. To ensure the system is completely cleared of the exploit’s effects after your test, you should clear the kernel’s page cache:
# Drop kernel page caches to clean up after exploit testing
echo 3 | sudo tee /proc/sys/vm/drop_cachesWhy this is necessary
As noted by security professionals on Reddit, failing to drop the caches can lead to misleading results where the modified binary continues to execute in its compromised state even after a mitigation (like the initcall_blacklist or module unloading) has been applied. Running echo 3 > /proc/sys/vm/drop_caches forces the kernel to discard the cached page data, ensuring that the next time the target binary (e.g., /usr/bin/su) is executed, the kernel loads the clean, original version from the disk.
Warning: Only run this on systems you own or are authorized to test. Never execute this exploit on production systems.