• [^] # Re: Après une récente vulnérabilité de SSH, Systemd réduit ses dépendances.

    Posté par . En réponse au lien After a Recent SSH Vulnerability, Systemd Reduces Dependencies. Évalué à 5. Dernière modification le 07 avril 2024 à 07:14.

    On peut quand même, je pense, regretter que systemd utilise un socket AF_UNIX pour ça, et pas juste un pipe.

    Un simple pipe aurait éviter de s'emmerder avec sockaddr_un & co, ça aurait pu éviter ce bloc:

     memset(&addr, 0, sizeof(addr));
     addr.sun_family = AF_UNIX;
     if (strlcpy(addr.sun_path, path,
     sizeof(addr.sun_path)) >= sizeof(addr.sun_path)) {
     error_f("socket path \"%s\" too long", path);
     goto out;
     }
     /* Support for abstract socket */
     if (addr.sun_path[0] == '@')
     addr.sun_path[0] = 0;
     if ((fd = socket(PF_UNIX, SOCK_DGRAM, 0)) == -1) {
     error_f("socket \"%s\": %s", path, strerror(errno));
     goto out;
     }
     if (connect(fd, &addr, sizeof(addr)) != 0) {
     error_f("socket \"%s\" connect: %s", path, strerror(errno));
     goto out;
     }

    qui représente une portion non-négligeable du patch d'OpenSSH. J'imagine que le socket est réutilisé pour autre chose par libsystemd0, mais tout de même.

    Il y a peut-être (probablement!) d'autres aspects auxquels je ne pense pas, ceci dit. Ca fait longtemps que j'ai pas pratiqué.