Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S941990AbcLWGUW (ORCPT ); Fri, 23 Dec 2016 01:20:22 -0500 Received: from mail-ua0-f170.google.com ([209.85.217.170]:35688 "EHLO mail-ua0-f170.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751150AbcLWGUU (ORCPT ); Fri, 23 Dec 2016 01:20:20 -0500 MIME-Version: 1.0 From: Keno Fischer Date: Fri, 23 Dec 2016 01:19:38 -0500 Message-ID: Subject: Why do Zombie process' /proc entries have uid 0? To: linux-kernel@vger.kernel.org Content-Type: text/plain; charset=UTF-8 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 821 Lines: 32 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/ directory $ stat /proc/77078 File: '/proc/77078' Access: (0555/dr-xr-xr-x) Uid: ( 1000/ keno) Gid: ( 1000/ keno) but most files in /proc/ 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