public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
* Patch: Hide process info from other users/users not in my group
@ 2007-11-20 10:34 Daniel Reichelt
  2007-11-20 17:53 ` Johannes Weiner
  2007-11-21 18:03 ` Pavel Machek
  0 siblings, 2 replies; 6+ messages in thread
From: Daniel Reichelt @ 2007-11-20 10:34 UTC (permalink / raw)
  To: linux-kernel

Hi list,

this patch sets (if the corresponding kconfig option is active) the access
modes of /proc/<pid>-dirs to 550 instead of 555 in order to provide some
privacy to users. Tools like lsof and ps to spy out on other users become
ineffective.

Cheers,
--
Daniel Reichelt

# diff -Naur linux-2.6.23.8/fs/Kconfig linux-2.6.23.8-dhr/fs/Kconfig
--- linux-2.6.23.8/fs/Kconfig   2007-11-16 19:14:27.000000000 +0100
+++ linux-2.6.23.8-dhr/fs/Kconfig       2007-11-20 11:33:18.000000000 +0100
@@ -918,6 +918,17 @@
         help
         Exports the dump image of crashed kernel in ELF format.

+config PROC_SECURED_PID_DIRS
+       bool "chmod /proc/<pid>-dirs to 550"
+       depends on PROC_FS
+       default n
+       help
+         chmod /proc/<pid>-dirs to 550 instead of 555 which provides a bit
+         moreprivacy to users on your system as only the user's and the user's
+         group's process details may be viewed. Other users' tasks running on
+         the system will be completely hidden from the means of utilities like
+         ps or lsof.
+
 config PROC_SYSCTL
        bool "Sysctl support (/proc/sys)" if EMBEDDED
        depends on PROC_FS
# diff -Naur linux-2.6.23.8/fs/proc/base.c linux-2.6.23.8-dhr/fs/proc/base.c
--- linux-2.6.23.8/fs/proc/base.c       2007-11-16 19:14:27.000000000 +0100
+++ linux-2.6.23.8-dhr/fs/proc/base.c   2007-11-20 11:31:31.000000000 +0100
@@ -2200,7 +2200,11 @@
        if (!inode)
                goto out;

+#ifdef CONFIG_PROC_SECURED_PID_DIRS
+       inode->i_mode = S_IFDIR|S_IRUSR|S_IRGRP|S_IXUSR|S_IXGRP;
+#else
        inode->i_mode = S_IFDIR|S_IRUGO|S_IXUGO;
+#endif
        inode->i_op = &proc_tgid_base_inode_operations;
        inode->i_fop = &proc_tgid_base_operations;
        inode->i_flags|=S_IMMUTABLE;

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

end of thread, other threads:[~2007-11-25 17:44 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2007-11-20 10:34 Patch: Hide process info from other users/users not in my group Daniel Reichelt
2007-11-20 17:53 ` Johannes Weiner
2007-11-20 19:42   ` Daniel Reichelt
2007-11-21 10:57   ` Daniel Reichelt
2007-11-21 18:03 ` Pavel Machek
2007-11-25 17:44   ` Daniel Reichelt

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