News for hackers. Stuff that matters.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by Filligree on Saturday March 22, 2025 @11:16AM (#43446311)
I’ll try it, but just off the bat, how does this compare to bubblewrap?
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by bitbang on Saturday March 22, 2025 @11:50AM (#43446616)
If I understand it correctly, landlock is an API used by an app to sandbox itself. The app itself controls the sandboxing. Bubble wrap is user space tooling external to the app, so the app had no direct awareness or control of its sandboxing. The scenarios each is intended for are orthogonal to one another.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by amarshall on Saturday March 22, 2025 @11:53AM (#43446641)
Landlock can be used to sandbox a launched sub process, as it is here, just as the Kernel APIs used by Bubblewrap could (and sometimes are!) used by programs to sandbox themselves.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by 1oooqooq on Saturday March 22, 2025 @12:33PM (#43446897)
not exactly correct. bubblewrap, firejail, and i not sure, but maybe even apparmour, all remove capabilities and create+join restricted fs/net namespaces, and then fork the actual thing you want to execute. so it's exactly the same concept, but those use the cap and cgroups.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by camkego on Saturday March 22, 2025 @11:23AM (#43446394)
I also would like to understand the differences relative to bubblewrap
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by codedokode on Saturday March 22, 2025 @03:03PM (#43447820)
Bubblewrap is very limited, for example it doesn't allow to grant access to /proc/self/exe without giving access to whole /proc subsystem. So I had to write an emulation of /proc in Python and mount it with FUSE to work around this. I wonder if this issue is fixed in landlock, firejail and others.

Also bubblewrap cannot ask for a decision in runtime: you must set up the rules beforehand.

Re:Landrun: Sandbox any Linux process using Landlock, no roo... by mid-kid on Sunday March 23, 2025 @11:19AM (#43453504)
Emulating /proc isn't super interesting when you can simply enter a new process namespace.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by codedokode on Sunday March 23, 2025 @09:20PM (#43457170)
This doesn't allow hiding things like /proc/cpuinfo or /proc/cmdline or /proc/modules etc.
Re:Landrun: Sandbox any Linux process using Landlock, no roo... by BoingBoomTschak on Sunday March 23, 2025 @06:58AM (#43452153)
Same question. One thing I really dislike in Bubblewrap is that I must share the whole net user namespace even if all I want to do is use UNIX domain sockets.

Since I only see net options specifying ports, does this handle this use case?

Re:Landrun: Sandbox any Linux process using Landlock, no roo... by coppsilgold on Sunday March 23, 2025 @08:06PM (#43456848)
> if all I want to do is use UNIX domain sockets

I routinely --unshare-net with UDS ro-binds.

You may be using abstract sockets (@/path/uds.sock) and those do require the same netns I think.

Re:Landrun: Sandbox any Linux process using Landlock, no roo... by l0kod on Tuesday March 25, 2025 @01:26PM (#43473727)
Landlock supports scoped abstract UNIX socket: https://docs.kernel.org/userspace-api/landlock.html#ipc-scop...

Landlock doesn't use namespaces, they are orthogonal.