<s>
Namespaces	O
are	O
a	O
feature	O
of	O
the	O
Linux	B-Operating_System
kernel	I-Operating_System
that	O
partitions	O
kernel	B-Operating_System
resources	O
such	O
that	O
one	O
set	O
of	O
processes	B-Operating_System
sees	O
one	O
set	O
of	O
resources	O
while	O
another	O
set	O
of	O
processes	B-Operating_System
sees	O
a	O
different	O
set	O
of	O
resources	O
.	O
</s>
<s>
The	O
feature	O
works	O
by	O
having	O
the	O
same	O
namespace	O
for	O
a	O
set	O
of	O
resources	O
and	O
processes	B-Operating_System
,	O
but	O
those	O
namespaces	O
refer	O
to	O
distinct	O
resources	O
.	O
</s>
<s>
Examples	O
of	O
such	O
resources	O
are	O
process	B-Operating_System
IDs	I-Operating_System
,	O
host-names	O
,	O
user	O
IDs	O
,	O
file	O
names	O
,	O
some	O
names	O
associated	O
with	O
network	O
access	O
,	O
and	O
Inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
Namespaces	O
are	O
a	O
fundamental	O
aspect	O
of	O
containers	B-Application
in	O
Linux	B-Operating_System
.	O
</s>
<s>
process	B-Operating_System
ID	I-Operating_System
)	O
as	O
well	O
as	O
for	O
a	O
particular	O
space	O
of	O
names	O
.	O
</s>
<s>
A	O
Linux	B-Operating_System
system	O
starts	O
out	O
with	O
a	O
single	O
namespace	O
of	O
each	O
type	O
,	O
used	O
by	O
all	O
processes	B-Operating_System
.	O
</s>
<s>
Processes	B-Operating_System
can	O
create	O
additional	O
namespaces	O
and	O
also	O
join	O
different	O
namespaces	O
.	O
</s>
<s>
Linux	B-Architecture
namespaces	I-Architecture
were	O
inspired	O
by	O
the	O
wider	O
namespace	O
functionality	O
used	O
heavily	O
throughout	O
Plan	B-Operating_System
9	I-Operating_System
from	I-Operating_System
Bell	I-Operating_System
Labs	I-Operating_System
.	O
</s>
<s>
The	O
Linux	B-Architecture
Namespaces	I-Architecture
originated	O
in	O
2002	O
in	O
the	O
2.4.19	O
kernel	B-Operating_System
with	O
work	O
on	O
the	O
mount	O
namespace	O
kind	O
.	O
</s>
<s>
Adequate	O
containers	B-Application
support	O
functionality	O
was	O
finished	O
in	O
kernel	B-Operating_System
version	O
3.8	O
with	O
the	O
introduction	O
of	O
User	O
namespaces	O
.	O
</s>
<s>
Since	O
kernel	B-Operating_System
version	O
5.6	O
,	O
there	O
are	O
8	O
kinds	O
of	O
namespaces	O
.	O
</s>
<s>
The	O
PID	B-Operating_System
namespace	O
provides	O
processes	B-Operating_System
with	O
an	O
independent	O
set	O
of	O
process	B-Operating_System
IDs	I-Operating_System
(	O
PIDs	O
)	O
from	O
other	O
namespaces	O
.	O
</s>
<s>
PID	B-Operating_System
namespaces	O
are	O
nested	O
,	O
meaning	O
when	O
a	O
new	O
process	O
is	O
created	O
it	O
will	O
have	O
a	O
PID	B-Operating_System
for	O
each	O
namespace	O
from	O
its	O
current	O
namespace	O
up	O
to	O
the	O
initial	O
PID	B-Operating_System
namespace	O
.	O
</s>
<s>
Hence	O
the	O
initial	O
PID	B-Operating_System
namespace	O
is	O
able	O
to	O
see	O
all	O
processes	B-Operating_System
,	O
albeit	O
with	O
different	O
PIDs	O
than	O
other	O
namespaces	O
will	O
see	O
processes	B-Operating_System
with	O
.	O
</s>
<s>
The	O
first	O
process	O
created	O
in	O
a	O
PID	B-Operating_System
namespace	O
is	O
assigned	O
the	O
process	B-Operating_System
ID	I-Operating_System
number	O
1	O
and	O
receives	O
most	O
of	O
the	O
same	O
special	O
treatment	O
as	O
the	O
normal	O
init	B-Operating_System
process	O
,	O
most	O
notably	O
that	O
orphaned	B-Operating_System
processes	I-Operating_System
within	O
the	O
namespace	O
are	O
attached	O
to	O
it	O
.	O
</s>
<s>
This	O
also	O
means	O
that	O
the	O
termination	O
of	O
this	O
PID	B-Operating_System
1	O
process	O
will	O
immediately	O
terminate	O
all	O
processes	B-Operating_System
in	O
its	O
PID	B-Operating_System
namespace	O
and	O
any	O
descendants	O
.	O
</s>
<s>
Network	O
namespaces	O
virtualize	O
the	O
network	B-Protocol
stack	I-Protocol
.	O
</s>
<s>
On	O
creation	O
,	O
a	O
network	O
namespace	O
contains	O
only	O
a	O
loopback	B-Protocol
interface	O
.	O
</s>
<s>
Each	O
namespace	O
will	O
have	O
a	O
private	O
set	O
of	O
IP	B-Protocol
addresses	I-Protocol
,	O
its	O
own	O
routing	B-Protocol
table	I-Protocol
,	O
socket	B-Protocol
listing	O
,	O
connection	O
tracking	O
table	O
,	O
firewall	B-Application
,	O
and	O
other	O
network-related	O
resources	O
.	O
</s>
<s>
IPC	O
namespaces	O
isolate	O
processes	B-Operating_System
from	O
SysV	B-Operating_System
style	O
inter-process	B-Operating_System
communication	I-Operating_System
.	O
</s>
<s>
This	O
prevents	O
processes	B-Operating_System
in	O
different	O
IPC	O
namespaces	O
from	O
using	O
,	O
for	O
example	O
,	O
the	O
SHM	O
family	O
of	O
functions	O
to	O
establish	O
a	O
range	O
of	O
shared	O
memory	O
between	O
the	O
two	O
processes	B-Operating_System
.	O
</s>
<s>
UTS	O
(	O
UNIX	O
Time-Sharing	B-General_Concept
)	O
namespaces	O
allow	O
a	O
single	O
system	O
to	O
appear	O
to	O
have	O
different	O
host	B-Protocol
and	O
domain	O
names	O
to	O
different	O
processes	B-Operating_System
.	O
</s>
<s>
"	O
When	O
a	O
process	O
creates	O
a	O
new	O
UTS	O
namespace	O
...	O
the	O
hostname	B-Protocol
and	O
domain	O
of	O
the	O
new	O
UTS	O
namespace	O
are	O
copied	O
from	O
the	O
corresponding	O
values	O
in	O
the	O
caller	O
's	O
UTS	O
namespace.	O
"	O
</s>
<s>
User	O
namespaces	O
are	O
a	O
feature	O
to	O
provide	O
both	O
privilege	O
isolation	O
and	O
user	O
identification	O
segregation	O
across	O
multiple	O
sets	O
of	O
processes	B-Operating_System
available	O
since	O
kernel	B-Operating_System
3.8	O
.	O
</s>
<s>
With	O
administrative	O
assistance	O
it	O
is	O
possible	O
to	O
build	O
a	O
container	B-Application
with	O
seeming	O
administrative	O
rights	O
without	O
actually	O
giving	O
elevated	O
privileges	O
to	O
user	O
processes	B-Operating_System
.	O
</s>
<s>
Like	O
the	O
PID	B-Operating_System
namespace	O
,	O
user	O
namespaces	O
are	O
nested	O
and	O
each	O
new	O
user	O
namespace	O
is	O
considered	O
to	O
be	O
a	O
child	O
of	O
the	O
user	O
namespace	O
that	O
created	O
it	O
.	O
</s>
<s>
A	O
user	O
namespace	O
contains	O
a	O
mapping	O
table	O
converting	O
user	O
IDs	O
from	O
the	O
container	B-Application
's	O
point	O
of	O
view	O
to	O
the	O
system	O
's	O
point	O
of	O
view	O
.	O
</s>
<s>
This	O
allows	O
,	O
for	O
example	O
,	O
the	O
root	B-Application
user	I-Application
to	O
have	O
user	O
id	O
0	O
in	O
the	O
container	B-Application
but	O
is	O
actually	O
treated	O
as	O
user	O
id	O
1,400,000	O
by	O
the	O
system	O
for	O
ownership	O
checks	O
.	O
</s>
<s>
A	O
user	O
with	O
administrative	B-Application
privileges	I-Application
in	O
the	O
appropriate	O
user	O
namespace	O
will	O
be	O
allowed	O
to	O
perform	O
administrative	O
actions	O
within	O
that	O
other	O
namespace	O
type	O
.	O
</s>
<s>
For	O
example	O
,	O
if	O
a	O
process	O
has	O
administrative	O
permission	O
to	O
change	O
the	O
IP	B-Protocol
address	I-Protocol
of	O
a	O
network	O
interface	O
,	O
it	O
may	O
do	O
so	O
as	O
long	O
as	O
its	O
own	O
user	O
namespace	O
is	O
the	O
same	O
as	O
(	O
or	O
ancestor	O
of	O
)	O
the	O
user	O
namespace	O
that	O
owns	O
the	O
network	O
namespace	O
.	O
</s>
<s>
The	O
cgroup	B-Application
namespace	O
type	O
hides	O
the	O
identity	O
of	O
the	O
control	B-Application
group	I-Application
of	O
which	O
process	O
is	O
a	O
member	O
.	O
</s>
<s>
A	O
process	O
in	O
such	O
a	O
namespace	O
,	O
checking	O
which	O
control	B-Application
group	I-Application
any	O
process	O
is	O
part	O
of	O
,	O
would	O
see	O
a	O
path	O
that	O
is	O
actually	O
relative	O
to	O
the	O
control	B-Application
group	I-Application
set	O
at	O
creation	O
time	O
,	O
hiding	O
its	O
true	O
control	B-Application
group	I-Application
position	O
and	O
identity	O
.	O
</s>
<s>
This	O
namespace	O
type	O
has	O
existed	O
since	O
March	O
2016	O
in	O
Linux	B-Operating_System
4.6	O
.	O
</s>
<s>
The	O
time	O
namespace	O
allows	O
processes	B-Operating_System
to	O
see	O
different	O
system	O
times	O
in	O
a	O
way	O
similar	O
to	O
the	O
UTS	O
namespace	O
.	O
</s>
<s>
It	O
was	O
proposed	O
in	O
2018	O
and	O
landed	O
on	O
Linux	B-Operating_System
5.6	O
,	O
which	O
was	O
released	O
in	O
March	O
2020	O
.	O
</s>
<s>
The	O
syslog	O
namespace	O
was	O
proposed	O
by	O
Rui	O
Xiang	O
,	O
an	O
engineer	O
at	O
Huawei	O
,	O
but	O
was	O
n't	O
merged	O
into	O
the	O
linux	B-Operating_System
kernel	I-Operating_System
.	O
</s>
<s>
systemd	B-Application
implemented	O
a	O
similar	O
feature	O
called	O
“	O
journal	O
namespace	O
”	O
in	O
February	O
2020	O
.	O
</s>
<s>
The	O
kernel	B-Operating_System
assigns	O
each	O
process	O
a	O
symbolic	O
link	O
per	O
namespace	O
kind	O
in	O
/proc/xxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxxx1/ns/	O
.	O
</s>
<s>
Various	O
container	B-Application
software	O
use	O
Linux	B-Architecture
namespaces	I-Architecture
in	O
combination	O
with	O
cgroups	B-Application
to	O
isolate	O
their	O
processes	B-Operating_System
,	O
including	O
Docker	B-Language
and	O
LXC	B-Application
.	O
</s>
<s>
Other	O
applications	O
,	O
such	O
as	O
Google	B-Application
Chrome	I-Application
make	O
use	O
of	O
namespaces	O
to	O
isolate	O
its	O
own	O
processes	B-Operating_System
which	O
are	O
at	O
risk	O
from	O
attack	O
on	O
the	O
internet	O
.	O
</s>
<s>
There	O
is	O
also	O
an	O
unshare	O
wrapper	O
in	O
util-linux	B-Application
.	O
</s>
