• Yossi Gottlieb's avatar
    Fix issue of listen before chmod on Unix sockets (CVE-2023-45145) · 1119ecae
    Yossi Gottlieb authored
    Before this commit, Unix socket setup performed chmod(2) on the socket
    file after calling listen(2). Depending on what umask is used, this
    could leave the file with the wrong permissions for a short period of
    time. As a result, another process could exploit this race condition and
    establish a connection that would otherwise not be possible.
    
    We now make sure the socket permissions are set up prior to calling
    listen(2).
    1119ecae
anet.c 22.2 KB