All of lore.kernel.org
 help / color / mirror / Atom feed
* Isolating abstract sockets
@ 2022-12-18 19:29 Stefan Bavendiek
  2023-10-24 13:46 ` Serge E. Hallyn
  0 siblings, 1 reply; 19+ messages in thread
From: Stefan Bavendiek @ 2022-12-18 19:29 UTC (permalink / raw)
  To: kernel-hardening; +Cc: linux-hardening

[-- Attachment #1: Type: text/plain, Size: 1643 bytes --]

When building userspace application sandboxes, one issue that does not seem trivial to solve is the isolation of abstract sockets.

While most IPC mechanism can be isolated by mechanisms like mount namespaces, abstract sockets are part of the network namespace.
It is possible to isolate abstract sockets by using a new network namespace, however, unprivileged processes can only create a new empty network namespace, which removes network access as well and makes this useless for network clients.

Same linux sandbox projects try to solve this by bridging the existing network interfaces into the new namespace or use something like slirp4netns to archive this, but this does not look like an ideal solution to this problem, especially since sandboxing should reduce the kernel attack surface without introducing more complexity.

Aside from containers using namespaces, sandbox implementations based on seccomp and landlock would also run into the same problem, since landlock only provides file system isolation and seccomp cannot filter the path argument and therefore it can only be used to block new unix domain socket connections completely.

Currently there does not seem to be any way to disable network namespaces in the kernel without also disabling unix domain sockets.

The question is how to solve the issue of abstract socket isolation in a clean and efficient way, possibly even without namespaces.
What would be the ideal way to implement a mechanism to disable abstract sockets either globally or even better, in the context of a process.
And would such a patch have a realistic chance to make it into the kernel?

- Stefan

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

^ permalink raw reply	[flat|nested] 19+ messages in thread
* Isolating abstract sockets
@ 2023-01-26  6:26 Stefan Bavendiek
  0 siblings, 0 replies; 19+ messages in thread
From: Stefan Bavendiek @ 2023-01-26  6:26 UTC (permalink / raw)
  To: kernelnewbies


[-- Attachment #1.1: Type: text/plain, Size: 1825 bytes --]

Hi,

Im trying to find a solution to a problem in the context of user space sandbox engineering on Linux and would appreciate any comments to guide me into the right direction in order to possible create a kernel patch that solves this problem:

When building userspace application sandboxes, one issue that does not seem trivial to solve is the isolation of abstract sockets.

While most IPC mechanism can be isolated by mechanisms like mount namespaces, abstract sockets are part of the network namespace.
It is possible to isolate abstract sockets by using a new network namespace, however, unprivileged processes can only create a new empty network namespace, which removes network access as well and makes this useless for network clients.

Same linux sandbox projects try to solve this by bridging the existing network interfaces into the new namespace or use something like slirp4netns to archive this, but this does not look like an ideal solution to this problem, especially since sandboxing should reduce the kernel attack surface without introducing more complexity.

Aside from containers using namespaces, sandbox implementations based on seccomp and landlock would also run into the same problem, since landlock only provides file system isolation and seccomp cannot filter the path argument and therefore it can only be used to block new unix domain socket connections completely.

Currently there does not seem to be any way to disable network namespaces in the kernel without also disabling unix domain sockets.

The question is how to solve the issue of abstract socket isolation in a clean and efficient way, possibly even without namespaces.
What would be the ideal way to implement a mechanism to disable abstract sockets either globally or even better, in the context of a process.

Thank you

- Stefan

[-- Attachment #1.2: signature.asc --]
[-- Type: application/pgp-signature, Size: 833 bytes --]

[-- Attachment #2: Type: text/plain, Size: 170 bytes --]

_______________________________________________
Kernelnewbies mailing list
Kernelnewbies@kernelnewbies.org
https://lists.kernelnewbies.org/mailman/listinfo/kernelnewbies

^ permalink raw reply	[flat|nested] 19+ messages in thread

end of thread, other threads:[~2023-11-02 14:50 UTC | newest]

Thread overview: 19+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-12-18 19:29 Isolating abstract sockets Stefan Bavendiek
2023-10-24 13:46 ` Serge E. Hallyn
2023-10-24 14:05   ` Boris Lukashev
2023-10-24 14:15     ` Serge E. Hallyn
2023-10-24 15:55       ` Boris Lukashev
2023-10-24 16:11         ` Serge E. Hallyn
2023-10-24 14:14   ` Paul Moore
2023-10-24 14:18     ` Serge E. Hallyn
2023-10-24 14:29       ` Paul Moore
2023-10-24 16:07         ` Serge E. Hallyn
2023-10-25 11:54           ` Mickaël Salaün
2023-10-31 20:40           ` Stefan Bavendiek
2023-11-01 10:56             ` Mickaël Salaün
2023-11-01 16:23               ` Jann Horn
2023-11-02 14:50                 ` Mickaël Salaün
2023-10-25 17:10   ` Jann Horn
2023-10-25 17:22     ` Serge E. Hallyn
2023-10-25 17:41       ` Jann Horn
2023-01-26  6:26 Stefan Bavendiek

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.