Questions tagged [linux-namespaces]

For questions regarding Linux kernel's namespaces mechanism.

143 questions
1
vote
1 answer

Reuse namespaces of process started by bubblewrap

Starting a shell with this: bwrap --unshare-pid --unshare-user --dev-bind / / bash In another shell on the host we can see this with lsns: 4026532550 user 2 1799976 user bwrap --unshare-pid --unshare-user --dev-bind / / bash 4026532552 mnt …
Jallan
  • 11
  • 1
1
vote
1 answer

Can't enter mount namespace created by a setuid process

A root-owned setuid bit daemon switches back to the real user and creates a mount namespace. A user-owned executable with CAP_SYS_ADMIN and CAP_SYS_CHROOT bits set tries to enter that namespace and fails. daemon.c: #ifndef _GNU_SOURCE #define…
Velkan
  • 7,067
  • 6
  • 43
  • 87
1
vote
1 answer

ctrl+c can not interrupt process in new namespace by 'sudo unshare -fp bash'

run bash in a new namespace with unshare pid $ sudo unshare -fp bash then run cat, and try to interrupt by press ctrl+c $ cat ^C cat is not killed. it seems cat not receive the SIGINT signal, but press ctrl+d, cat exit. there's no this problem, if…
yuanjianpeng
  • 335
  • 1
  • 9
1
vote
0 answers

Bind Mount Parent Mount Namespace: EOVERFLOW

Is it possible to create a bind mount to the parent namespace when creating a container? I have code that does the following operations (error checking stripped): struct clone_args cloneArguments; memset(&cloneArguments, 0,…
gudenau
  • 500
  • 5
  • 19
1
vote
0 answers

VLAN tag is being removed on veth interface

I have two Linux namespaces with a bridge between them, and two pairs of veth pipes connecting namespaces with the bridge: ns1 ----- Bridge ----- ns2 I didn't add any VLAN sub-interfaces over veth. An application I run on ns1 open a raw AF_PACKET…
Mark
  • 6,052
  • 8
  • 61
  • 129
1
vote
1 answer

Does containers in a Kubernetes Pod run in different "mount" namespaces?

Does containers in a Kubernetes Pod run in different "mount" namespaces? As per what i read in few online resources , when a container is launched , each container points to an isolated file system and the only thing that can be used to share file…
1
vote
1 answer

Allowing K8S daemonset to exist in the global pid namespace

I'm trying to configure a daemonset to run on the global pid namespace resulting the ability to see other processes in the host, including the containers' processes. I couldn't find an option to achieve this. In general, what I'm looking for is…
Eytan Naim
  • 159
  • 14
1
vote
0 answers

Couldn't connect to accessibility bus in network namespace

My ubuntu version is 18. I use commands to create a network namespace and open nautilus. sudo ip netns add net1 sudo ip netns exec net1 ip link set dev lo up sudo ip netns exec net1 nautilus Some warnings appear when opening…
1
vote
1 answer

netns: execute command from default namespace from another namespace

I ssh into a linux machine using nets namespace (command below) ip netns exec NAME_SPACE ssh root@192.168.2.100 From there I want to execute some command(say "ifconfig") in default name space from this.
1
vote
1 answer

Using POSIX semaphores between Linux kernel namespaces

I'm working on a C application using Linux namespaces, and one thing that's come up is the need to signal the child namespace from the parent using a semaphore (or something similar). Here's what I'm trying to do at the moment: #define…
DodoDude700
  • 165
  • 4
1
vote
1 answer

Editing root-owned files after "unshare -Ur"

Say I am in the initial user namespace and there is an empty root-owned file in some directory: tdiff@tp:~/temp/unshare$ sudo touch root.txt tdiff@tp:~/temp/unshare$ ls total 8.0K drwxrwxr-x 2 tdiff tdiff 4.0K Oct 18 02:37 . drwxr-xr-x 3 tdiff tdiff…
tdiff
  • 113
  • 7
1
vote
1 answer

unable to open(/proc/$pid/ns/{namespace_files})

I've to join a process to a new namespace, so i'm extracting the namespace fd's of a process, so that it can call setns on those fd's. But the problem is all returned fd's are -1s. I did this: cout<
user13145713
  • 109
  • 8
1
vote
1 answer

How to write Linux kernel module that is a new instance in each network namespace?

is using struct pernet_operations and register_pernet_subsys(..) the correct way to have a state per network namespace in a Linux kernel module? Or is there a way just mark a kernel module and it will have an independent state in each network…
mwarning
  • 721
  • 5
  • 22
1
vote
2 answers

How to provide file isolation using linux namespace

I am trying to run the same program in two linux namespace. The program needs to read and write the file /tmp/server.log. So I want to make sure that program A read/write server.log, but actually it reads and writes /tmp/server-A.log. And for…
mrmitzh
  • 35
  • 4
1
vote
1 answer

How to correctly implement mount namespaces in go

I have the following code mnt.go package main import ( "fmt" "log" "os" "os/exec" "syscall" ) func main() { fmt.Println("Entering go program") cmd := exec.Command("/bin/bash") cmd.Stdout = os.Stdout cmd.Stderr…
ashwnacharya
  • 14,601
  • 23
  • 89
  • 112