8000 pasta: fix pasta not working with `uid_mapping` by fumin · Pull Request #394 · google/nsjail · GitHub
[go: up one dir, main page]

Skip to content

pasta: fix pasta not working with uid_mapping - #394

Open
fumin wants to merge 1 commit into
google:masterfrom
fumin:uid_mapping_pasta
Open

fumin wants to merge 1 commit into
google:masterfrom
fumin:uid_mapping_pasta

Conversation

@fumin
@fumin fumin commented Nov 17, 2026 •
Copy link
Copy Markdown

Fixes #395

Steps to reproduce:

Run the following a couple of times:

nsjail --config uid_mapping_pasta_reproduce.conf

On a slow machine, nsjail fails with:

reapProc():386 Pasta process 6460 exited unexpectedly with status 1. Killing the jail.

Explanation:

There are two issues:

  1. Pasta joins the child's namespaces asynchronously, which it cannot do util the child calls execve when uid_mapping is turned on.
  2. Pasta cannot see /proc/<pid>/ns when uid_mapping is turned on
uid_mapping_pasta_reproduce.conf
mode: ONCE

uidmap {
  outside_id: "100000"
  use_newidmap: true
}
gidmap {
  outside_id: "100000"
  use_newidmap: true
}

clone_newnet: true
user_net {
  backend: PASTA
  # Without a pasta block, nsjail does not start pasta.
  pasta {}
}

mount {
  src: "/"
  dst: "/"
  is_bind: true
}

exec_bin {
  path: "/bin/sleep"
  arg: "1"
}

Steps to reproduce:

Run the following a couple of times:

nsjail --config uid_mapping_pasta_reproduce.conf

On a slow machine, nsjail fails with:

reapProc():386 Pasta process 6460 exited unexpectedly with status 1. Killing the jail.

Explanation:

There are two issues:

1. Pasta joins the child's namespaces asynchronously, which it cannot do
   util the child calls execve when uid_mapping is turned on.
2. Pasta cannot see /proc/<pid>/ns when uid_mapping is turned on

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

pasta: pasta fails with uid_mapping turned on

1 participant

0