Score:2

How to find out which kernel module opened a socket?

in flag

When I try to find the process for an opened socket using e.g. ss I get the following output:

❯ sudo ss -tulpen
Failed to open cgroup2 by ID
Failed to open cgroup2 by ID
Netid State  Recv-Q Send-Q         Local Address:Port   Peer Address:Port Process
udp   UNCONN 0      0                    0.0.0.0:33333       0.0.0.0:*     ino:14386 sk:1 cgroup:unreachable:9e4 <->
udp   UNCONN 0      0                       [::]:33333          [::]:*     ino:14387 sk:2 cgroup:unreachable:9e4 v6only:1 <->
tcp   LISTEN 0      50                 10.20.0.1:445         0.0.0.0:*     users:(("smbd",pid=336,fd=48)) ino:14500 sk:3 cgroup:/system.slice/smb.service <->
tcp   LISTEN 0      50                 10.20.0.1:139         0.0.0.0:*     users:(("smbd",pid=336,fd=49)) ino:14501 sk:8 cgroup:/system.slice/smb.service <->
tcp   LISTEN 0      4096                 0.0.0.0:80          0.0.0.0:*     users:(("docker-proxy",pid=25926,fd=4)) ino:108903 sk:1085 cgroup:/system.slice/docker.service <->
tcp   LISTEN 0      50                   0.0.0.0:443         0.0.0.0:*     users:(("sslh-select",pid=24592,fd=3)) uid:63671 ino:102824 sk:1001 cgroup:/system.slice/sslh-select.service <->
tcp   LISTEN 0      4096                    [::]:80             [::]:*     users:(("docker-proxy",pid=25938,fd=4)) ino:108912 sk:108d cgroup:/system.slice/docker.service v6only:1 <->
tcp   LISTEN 0      50                      [::]:443            [::]:*     users:(("sslh-select",pid=24592,fd=4)) uid:63671 ino:102825 sk:107e cgroup:/system.slice/sslh-select.service v6only:1 <->

I know I setup wireguard using the kernel module at UDP:33333 but I tend to forget stuff like that after some time. Is there a way to reliably determine the module responsible for a 'kernel' socket?

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.