linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* Why do Zombie process' /proc entries have uid 0?
@ 2016-12-23  6:19 Keno Fischer
  0 siblings, 0 replies; only message in thread
From: Keno Fischer @ 2016-12-23  6:19 UTC (permalink / raw)
  To: linux-kernel

This is mostly out of curiosity, but I was surprised by the behavior, so
I was hoping somebody might be able to explain why this behavior was
chosen. In particular, consider any zombie process, e.g.

$ cat /proc/77078/status
Name: test
State: Z (zombie)
Tgid: 77078
Ngid: 0
Pid: 77078
PPid: 77077
TracerPid: 0
Uid: 1000 1000 1000 1000
Gid: 1000 1000 1000 1000
[...]

now, this process has uid 1000, as does the /proc/<pid> directory

$ stat /proc/77078
  File: '/proc/77078'
Access: (0555/dr-xr-xr-x)  Uid: ( 1000/    keno)   Gid: ( 1000/    keno)

but most files in /proc/<pid> are owned by root:

$ stat /proc/77078/status
  File: '/proc/77078/status'
Access: (0444/-r--r--r--)  Uid: (    0/    root)   Gid: (    0/    root)

Why is this? Why don't these files remain owned by the same uid as the
process itself?

Keno

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2016-12-23  6:20 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-12-23  6:19 Why do Zombie process' /proc entries have uid 0? Keno Fischer

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).