As best I can tell you are (currently) vulnerable except on the 7.0 kernel. The patch hasn’t been backported, and it hasn’t been deliberately added by nixpkgs yet - usually NixOS isn’t contacted during embargoes.
Edit: nah, I missed the backport, thanks for correcting that @sjagoe and @raboof - Kernel 6.12 and earlier are vulnerable, but not 6.18.22+, 6.19.12+ and 7.0+.
After some looking, it seems that the fix was backported to linux 6.18.22, so nixos-25.11 is not vulnerable if you use boot.kernelPackages = pkgs.linuxPackages_6_18 (which currently provides 6.18.24).
commit fafe0fa2995a0f7073c1c358d7d3145bcc9aedd8
Author: Herbert Xu <herbert@gondor.apana.org.au>
Date: Thu Mar 26 15:30:20 2026 +0900
crypto: algif_aead - Revert to operating out-of-place
[ Upstream commit a664bf3d603dc3bdcf9ae47cc21e0daec706d7a5 ]
This mostly reverts commit 72548b093ee3 except for the copying of
the associated data.
There is no benefit in operating in-place in algif_aead since the
source and destination come from different mappings. Get rid of
all the complexity added for in-place operation and just copy the
AD directly.
Fixes: 72548b093ee3 ("crypto: algif_aead - copy AAD from src to dst")
Reported-by: Taeyang Lee <0wn@theori.io>
Signed-off-by: Herbert Xu <herbert@gondor.apana.org.au>
Signed-off-by: Sasha Levin <sashal@kernel.org>
I was wrong. I can reproduce the exploit by default on kernel 6.12 : we just need to replace the path in the script by something in the store (not in /run/wrappers), like /nix/store/hmfzj7wv3ynp9k03yqhz3d3yn8gnzcnk-shadow-4.18.0-su/bin/su for instance, and the exploit works.
I am wondering, how can /run/current-system/sw/bin/su be the dangerous one?
Maybe I am missing details in the CVE (which I haven’t read myself but trust our opsperson that it is basically a race with kernel locks), but /run/current-system/sw/bin/su doesn’t have suid, so I always expected only use of /run/wrappers/bin/su could trigger the issue.
as far as i understand, the python script needs the contents of su that gets executed when you run the su command. /run/current-system/sw/bin/su is world readable and contains the same content as /run/wrappers/bin/su (or i should say, where it points to). the script doesn’t care about the setuid or permissions of the exectuable, you execute it. the script needs to read the exact content.
it’s not really about reading the content, it’s just about having the read permission at all. Also the bug has nothing to do with setuid at all; setuid is just the most obvious way to exploit it. The impact of the bug is:
Any user who can open a file with read perms also has the ability to corrupt the page cache of that file arbitrarily.
So yes the simplest thing to do is replace the su setuid binary’s contents with one that just lets you escalate to root. Oddly enough, that’s not possible on nixos because things in /run/wrappers/bin usually only have the execute perm set, not the read perm, for normal users. But similarly trivial exploits with no setuid exist. There are plenty of files on the system that can give anybody root, but don’t because only root can edit them, e.g. /etc/passwd.
Here’s a slightly safer and more portable PoC script. I’ve modified it to only “write” oops, haxxed to /etc/issue instead. It also works on aarch64-linux and hopefully many other platforms.
Rebooting after running the exploit is also recommended.
On NixOS that is a symlink to the store so it also does eventually “write” to the store.