public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* proc hidepid=2 and SGID programs
@ 2013-09-07  8:51 Christian Kujau
  2013-09-09  6:42 ` Eric W. Biederman
  0 siblings, 1 reply; 8+ messages in thread
From: Christian Kujau @ 2013-09-07  8:51 UTC (permalink / raw)
  To: LKML; +Cc: Vasiliy Kulikov

Hi,

I was wondering why I cannot see processes that were started from SGID 
programs:

================================
$ grep ^proc /proc/mounts
proc /proc proc rw,nosuid,nodev,noexec,relatime,hidepid=2 0 0

$ ls -n `which ssh-agent`
-rwxr-sr-x 1 0 103 132748 Feb  8  2013 /usr/bin/ssh-agent

$ eval `ssh-agent`
Agent pid 3177

$ ps -o euid,ruid,suid,egid,rgid,sgid,pid,comm -p 3177
 EUID  RUID  SUID  EGID  RGID  SGID   PID COMMAND

$ sudo ps -o euid,ruid,suid,egid,rgid,sgid,pid,comm -p 3177
 EUID  RUID  SUID  EGID  RGID  SGID   PID COMMAND
 1000  1000  1000  1000  1000   103  3177 ssh-agent
================================

Although the binary has the SGID bit set, the process seems to belong to 
myself (uid/gid 1000), as it probably dropped ssh-group permissions after 
start. But the PID is not visible in /proc and I cannot "find" it:

================================
$ pgrep ssh-agent; echo $?
1

$ pkill ssh-agent; echo $?
1

$ kill 3177; echo $?
0
================================

Because I knew the PID, I could terminate it of course. Is this expected 
behaviour? Shouldn't my own processes be visible to myself, even with 
/proc mounted with the hidepid=2 option?

Christian.
-- 
BOFH excuse #412:

Radial Telemetry Infiltration

^ permalink raw reply	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2013-09-19 11:42 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-09-07  8:51 proc hidepid=2 and SGID programs Christian Kujau
2013-09-09  6:42 ` Eric W. Biederman
2013-09-10  8:30   ` Christian Kujau
2013-09-10 10:00     ` Eric W. Biederman
2013-09-14 11:14     ` Vasiliy Kulikov
2013-09-15  8:58       ` Christian Kujau
2013-09-15  9:01         ` Christian Kujau
2013-09-19 11:42         ` Vasiliy Kulikov

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox