Menu

#49 pstree doesn't work on 3.3 kernel with hidepid feature

Next Release
closed
nobody
None
5
2014-01-31
2012-03-21
arekm
No

linux kernel 3.3 has a feature which allows to hide information about not own processes in /proc.

cat /proc/mounts |grep ^/proc

/proc /proc proc rw,relatime,gid=17,hidepid=2 0 0

(note hidepid=2)

The problem is that it also hides process with pid=1 and it seems that pstree needs pid 1 process to be working (aka output anything)

[arekm@carme /tmp]$ pstree -lpu
[arekm@carme /tmp]$ ps aux
USER PID %CPU %MEM VSZ RSS TTY STAT START TIME COMMAND
arekm 160785 0.0 0.0 4524 964 pts/16 S 12:10 0:00 -sh
arekm 160803 0.0 0.0 121840 1164 pts/16 R+ 12:10 0:00 ps aux

pstree (PSmisc) 22.16
Copyright (C) 1993-2009 Werner Almesberger and Craig Small

PSmisc comes with ABSOLUTELY NO WARRANTY.
This is free software, and you are welcome to redistribute it under
the terms of the GNU General Public License.
For more information about these matters, see the files named COPYING

short hidepid description: https://lwn.net/Articles/474645/

The fix would be not to rely on pid=1 existence/visibility.

Discussion

  • arekm

    arekm - 2012-03-21

    fix by introducing fake root pid

     
  • Craig Small

    Craig Small - 2012-05-19

    Thankyou for your report and patcn. This will be in psmisc 22.17

     
  • Craig Small

    Craig Small - 2014-01-31
    • status: pending --> closed
    • Group: --> Next Release
     

Anonymous
Anonymous

Add attachments
Cancel