cve-toolkit

CVE helper toolkit
git clone git://git.finwo.net/app/cve-toolkit
Log | Files | Refs | README | LICENSE

cve-2026-31431.c (969B)


      1 #include <linux/if_alg.h>
      2 #include <stdio.h>
      3 #include <string.h>
      4 #include <sys/socket.h>
      5 #include <unistd.h>
      6 
      7 #include "setup.h"
      8 
      9 int detector_cve_2026_31431(struct cve_context *ctx) {
     10   (void)ctx;
     11   int fd = socket(AF_ALG, SOCK_SEQPACKET, 0);
     12   if (fd < 0) {
     13     perror("socket");
     14     return 0;
     15   }
     16 
     17   struct sockaddr_alg sa;
     18   memset(&sa, 0, sizeof(sa));
     19   sa.salg_family = AF_ALG;
     20 
     21   strcpy((char *)sa.salg_type, "aead");
     22   strcpy((char *)sa.salg_name, "authencesn(hmac(sha256),cbc(aes))");
     23 
     24   if (bind(fd, (struct sockaddr *)&sa, sizeof(sa)) < 0) {
     25     return 0;
     26   }
     27 
     28   return 1;
     29 }
     30 
     31 __attribute__((constructor)) void detector_cve_2026_31431_setup() {
     32   detector_queue_append("CVE-2026-31431", "CopyFail",
     33                         "Add 'initcall_blacklist=algif_aead_init' to the Linux kernel cmdline.\n  For GRUB, add it to "
     34                         "GRUB_CMDLINE_LINUX in /etc/default/grub and run update-grub.",
     35                         detector_cve_2026_31431);
     36 }