No warranty implied, use at your own risk. But this short C program can check if your Linux machine is still vulnerable to Copy Fail (there's also this page with python code from our friends in Estonia
https://docs.hpc.ut.ee/public/cve-2026-31431/ )
Output includes "ARE available" or "NOT available"
Again: compile and run at your own risk. Don't just trust me blindly. Read the code.
#CopyFail #CVE-2026-31431
==============
#include
#include
#include
#include
#include
#include
int main(void) {
int sock;
struct sockaddr_alg sa;
// Prepare sockaddr_alg for AEAD/GCM
memset(&sa, 0, sizeof(sa));
sa.salg_family = AF_ALG;
strcpy((char *)sa.salg_type, "aead");
strcpy((char *)sa.salg_name, "gcm(aes)");
// Try to create AF_ALG socket
sock = socket(AF_ALG, SOCK_SEQPACKET, 0);
if (sock == -1) {
perror("socket(AF_ALG, aead)");
printf("algif_aead functions are NOT available (AF_ALG socket creation failed).\n");
return 1;
}
// Try to bind to AEAD/GCM
if (bind(sock, (struct sockaddr *)&sa, sizeof(sa)) == -1) {
perror("bind(AF_ALG, aead, gcm(aes))");
printf("algif_aead functions are NOT available (bind failed).\n");
close(sock);
return 1;
}
printf("algif_aead functions ARE available (AF_ALG AEAD bind succeeded).\n");
close(sock);
return 0;
}