Skip to content

bind mounted /var/run/netns acts differently if nsjail started before or after network namespace is created #230

@tsalminenforce

Description

@tsalminenforce

Bumped into this issue with current master (and older ones), where if there's a mount

mount {
  src: "/var/run/netns"
  dst: "/var/run/netns"
  rw: false 
  is_bind: true
  mandatory: false
}

then if I start bash in nsjail, create the namespace and try to access the namespace:

bash-5.1$ cat /var/run/netns/three3 
cat: /var/run/netns/three3: Permission denied

But if I stop the nsjail process and start it again:

bash-5.1$ cat /var/run/netns/three3 
cat: /var/run/netns/three3: Invalid argument

I know cat isn't the correct way to enter no namespace, but just here illustrating that (at least) network namespace created after the nsjail process started cannot be accessed.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions