patches and low-level development discussion
 help / color / mirror / code / Atom feed
* Can't get minijail0 working without bind-mounting /
@ 2025-11-23  6:38 Demi Marie Obenour
  2025-11-23 18:21 ` Demi Marie Obenour
  0 siblings, 1 reply; 3+ messages in thread
From: Demi Marie Obenour @ 2025-11-23  6:38 UTC (permalink / raw)
  To: minijail; +Cc: Alyssa Ross, Spectrum OS Development


[-- Attachment #1.1.1: Type: text/plain, Size: 629 bytes --]

I'm trying to get minijail0 to work without bind-mounting /, and I'm
running into lots of problems.  So far:

- Unprivileged user namespaces fail due to -EPERM in a mount syscall.

- Mounting a tmpfs over / always causes the program to be executed
  to not be found.

- `sudo ./minijail0.sh -v --profile=minimalistic-mountns /bin/ls`
  works, but doesn't actually do any sandboxing as it bind-mounts `/`.

Are there examples of how to use minijail0 properly?  Alternatively,
can I use it purely for seccomp and Landlock, and use bubblewrap to
handle namespacing?
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

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

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

* Re: Can't get minijail0 working without bind-mounting /
  2025-11-23  6:38 Can't get minijail0 working without bind-mounting / Demi Marie Obenour
@ 2025-11-23 18:21 ` Demi Marie Obenour
  2025-11-24 19:57   ` [minijail] " Mike Frysinger
  0 siblings, 1 reply; 3+ messages in thread
From: Demi Marie Obenour @ 2025-11-23 18:21 UTC (permalink / raw)
  To: minijail; +Cc: Alyssa Ross, Spectrum OS Development


[-- Attachment #1.1.1: Type: text/plain, Size: 791 bytes --]

On 11/23/25 01:38, Demi Marie Obenour wrote:
> I'm trying to get minijail0 to work without bind-mounting /, and I'm
> running into lots of problems.  So far:
> 
> - Unprivileged user namespaces fail due to -EPERM in a mount syscall.
> 
> - Mounting a tmpfs over / always causes the program to be executed
>   to not be found.
> 
> - `sudo ./minijail0.sh -v --profile=minimalistic-mountns /bin/ls`
>   works, but doesn't actually do any sandboxing as it bind-mounts `/`.
> 
> Are there examples of how to use minijail0 properly?  Alternatively,
> can I use it purely for seccomp and Landlock, and use bubblewrap to
> handle namespacing?

Forwarding to minijail mailing list.  The first message was rejected
for some reason.
-- 
Sincerely,
Demi Marie Obenour (she/her/hers)

[-- Attachment #1.1.2: OpenPGP public key --]
[-- Type: application/pgp-keys, Size: 7253 bytes --]

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

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

* Re: [minijail] Re: Can't get minijail0 working without bind-mounting /
  2025-11-23 18:21 ` Demi Marie Obenour
@ 2025-11-24 19:57   ` Mike Frysinger
  0 siblings, 0 replies; 3+ messages in thread
From: Mike Frysinger @ 2025-11-24 19:57 UTC (permalink / raw)
  To: Demi Marie Obenour; +Cc: minijail, Alyssa Ross, Spectrum OS Development

On Mon, Nov 24, 2025 at 1:57 PM Demi Marie Obenour wrote:
> On 11/23/25 01:38, Demi Marie Obenour wrote:
> > I'm trying to get minijail0 to work without bind-mounting /, and I'm
> > running into lots of problems.  So far:
> >
> > - Unprivileged user namespaces fail due to -EPERM in a mount syscall.

those errors come from the kernel, not minijail.  you prob want to
double check user namespaces constraints.

> > - Mounting a tmpfs over / always causes the program to be executed
> >   to not be found.

what is the command line you are using exactly, and is the program
you're trying to run statically or dynamically linked ?

> > - `sudo ./minijail0.sh -v --profile=minimalistic-mountns /bin/ls`
> >   works, but doesn't actually do any sandboxing as it bind-mounts `/`.

it sounds like you're conflating "empty filesystem" with "it's
sandboxed".  sandboxing (namespaces / container technology) is
composed of a multitude of layers.

what you describe here is correct.  check the set of mounts inside
that sandbox to see they're significantly reduced.

> > Are there examples of how to use minijail0 properly?

seems like you've already found some, and they're working correctly.
the website also links to more docs & practical examples.
https://google.github.io/minijail/

> > Alternatively,
> > can I use it purely for seccomp and Landlock, and use bubblewrap to
> > handle namespacing?

if the minijail config allows access to all the syscalls/privileges
that the program needs to set things up, then i don't see why not.
-mike

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

end of thread, other threads:[~2025-11-24 19:58 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2025-11-23  6:38 Can't get minijail0 working without bind-mounting / Demi Marie Obenour
2025-11-23 18:21 ` Demi Marie Obenour
2025-11-24 19:57   ` [minijail] " Mike Frysinger

Code repositories for project(s) associated with this public inbox

	https://spectrum-os.org/git/crosvm
	https://spectrum-os.org/git/doc
	https://spectrum-os.org/git/mktuntap
	https://spectrum-os.org/git/nixpkgs
	https://spectrum-os.org/git/spectrum
	https://spectrum-os.org/git/ucspi-vsock
	https://spectrum-os.org/git/www

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).