Skip to content

Open sockets should not be inherited by cores #361

@arisu3

Description

@arisu3

Sockets in the client are opened without SOCK_CLOEXEC (cbang does not set it by default). This causes the cores to inherit open network connections that they do not need. This is unnecessary and complicates sandboxing.

$ lsof -i tcp:7396 -a -c FahCore_ -c fah-client
COMMAND      PID    USER   FD   TYPE  DEVICE SIZE/OFF NODE NAME
fah-clien 406867 fahtest    9u  IPv4 2157736      0t0  TCP localhost:7396->localhost:34940 (ESTABLISHED)
fah-clien 406867 fahtest   10u  IPv4 1803050      0t0  TCP localhost:7396 (LISTEN)
fah-clien 406867 fahtest   27u  IPv4 1803652      0t0  TCP localhost:7396->localhost:47630 (ESTABLISHED)
FahCore_2 465571 fahtest   24u  IPv4 2110072      0t0  TCP localhost:7396->localhost:33774 (CLOSE_WAIT)
FahCore_2 465571 fahtest   27u  IPv4 1803652      0t0  TCP localhost:7396->localhost:47630 (ESTABLISHED)
FahCore_a 466366 fahtest    9u  IPv4 2157736      0t0  TCP localhost:7396->localhost:34940 (ESTABLISHED)
FahCore_a 466366 fahtest   27u  IPv4 1803652      0t0  TCP localhost:7396->localhost:47630 (ESTABLISHED)

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions