<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc/root.c, branch v3.4.96</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/proc/root.c?h=v3.4.96</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/proc/root.c?h=v3.4.96'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2012-04-05T22:25:50Z</updated>
<entry>
<title>proc: fix mount -t proc -o AAA</title>
<updated>2012-04-05T22:25:50Z</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segoon@openwall.com</email>
</author>
<published>2012-04-05T21:25:04Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=99663be772c827b8f5f594fe87eb4807be1994e5'/>
<id>urn:sha1:99663be772c827b8f5f594fe87eb4807be1994e5</id>
<content type='text'>
The proc_parse_options() call from proc_mount() runs only once at boot
time.  So on any later mount attempt, any mount options are ignored
because -&gt;s_root is already initialized.

As a consequence, "mount -o &lt;options&gt;" will ignore the options.  The
only way to change mount options is "mount -o remount,&lt;options&gt;".

To fix this, parse the mount options unconditionally.

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Reported-by: Arkadiusz Miskiewicz &lt;a.miskiewicz@gmail.com&gt;
Tested-by: Arkadiusz Miskiewicz &lt;a.miskiewicz@gmail.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Valdis Kletnieks &lt;Valdis.Kletnieks@vt.edu&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>procfs: add hidepid= and gid= mount options</title>
<updated>2012-01-11T00:30:54Z</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segooon@gmail.com</email>
</author>
<published>2012-01-10T23:11:31Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0499680a42141d86417a8fbaa8c8db806bea1201'/>
<id>urn:sha1:0499680a42141d86417a8fbaa8c8db806bea1201</id>
<content type='text'>
Add support for mount options to restrict access to /proc/PID/
directories.  The default backward-compatible "relaxed" behaviour is left
untouched.

The first mount option is called "hidepid" and its value defines how much
info about processes we want to be available for non-owners:

hidepid=0 (default) means the old behavior - anybody may read all
world-readable /proc/PID/* files.

hidepid=1 means users may not access any /proc/&lt;pid&gt;/ directories, but
their own.  Sensitive files like cmdline, sched*, status are now protected
against other users.  As permission checking done in proc_pid_permission()
and files' permissions are left untouched, programs expecting specific
files' modes are not confused.

hidepid=2 means hidepid=1 plus all /proc/PID/ will be invisible to other
users.  It doesn't mean that it hides whether a process exists (it can be
learned by other means, e.g.  by kill -0 $PID), but it hides process' euid
and egid.  It compicates intruder's task of gathering info about running
processes, whether some daemon runs with elevated privileges, whether
another user runs some sensitive program, whether other users run any
program at all, etc.

gid=XXX defines a group that will be able to gather all processes' info
(as in hidepid=0 mode).  This group should be used instead of putting
nonroot user in sudoers file or something.  However, untrusted users (like
daemons, etc.) which are not supposed to monitor the tasks in the whole
system should not be added to the group.

hidepid=1 or higher is designed to restrict access to procfs files, which
might reveal some sensitive private information like precise keystrokes
timings:

http://www.openwall.com/lists/oss-security/2011/11/05/3

hidepid=1/2 doesn't break monitoring userspace tools.  ps, top, pgrep, and
conky gracefully handle EPERM/ENOENT and behave as if the current user is
the only user running processes.  pstree shows the process subtree which
contains "pstree" process.

Note: the patch doesn't deal with setuid/setgid issues of keeping
preopened descriptors of procfs files (like
https://lkml.org/lkml/2011/2/7/368).  We rely on that the leaked
information like the scheduling counters of setuid apps doesn't threaten
anybody's privacy - only the user started the setuid program may read the
counters.

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Cc: Theodore Tso &lt;tytso@MIT.EDU&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Hugh Dickins &lt;hughd@google.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>procfs: parse mount options</title>
<updated>2012-01-11T00:30:54Z</updated>
<author>
<name>Vasiliy Kulikov</name>
<email>segooon@gmail.com</email>
</author>
<published>2012-01-10T23:11:27Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=97412950b10e64f347aec4a9b759395c2465adf6'/>
<id>urn:sha1:97412950b10e64f347aec4a9b759395c2465adf6</id>
<content type='text'>
Add support for procfs mount options.  Actual mount options are coming in
the next patches.

Signed-off-by: Vasiliy Kulikov &lt;segoon@openwall.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Randy Dunlap &lt;rdunlap@xenotime.net&gt;
Cc: "H. Peter Anvin" &lt;hpa@zytor.com&gt;
Cc: Greg KH &lt;greg@kroah.com&gt;
Cc: Theodore Tso &lt;tytso@MIT.EDU&gt;
Cc: Alan Cox &lt;alan@lxorguk.ukuu.org.uk&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>procfs: fix a vfsmount longterm reference leak</title>
<updated>2011-12-09T05:40:19Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-12-09T04:20:45Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=905ad269c55fc62bee3da29f7b1d1efeba8aa1e1'/>
<id>urn:sha1:905ad269c55fc62bee3da29f7b1d1efeba8aa1e1</id>
<content type='text'>
kern_mount() doesn't pair with plain mntput()...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>proc: make struct proc_dir_entry::name a terminal array rather than a pointer</title>
<updated>2011-07-27T19:50:45Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2011-07-27T18:47:03Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=09570f914914d2beb0db29c5a9c7344934f2fa8c'/>
<id>urn:sha1:09570f914914d2beb0db29c5a9c7344934f2fa8c</id>
<content type='text'>
Since __proc_create() appends the name it is given to the end of the PDE
structure that it allocates, there isn't a need to store a name pointer.
Instead we can just replace the name pointer with a terminal char array of
_unspecified_ length.  The compiler will simply append the string to statically
defined variables of PDE type overlapping any hole at the end of the structure
and, unlike specifying an explicitly _zero_ length array, won't give a warning
if you try to statically initialise it with a string of more than zero length.

Also, whilst we're at it:

 (1) Move namelen to end just prior to name and reduce it to a single byte
     (name shouldn't be longer than NAME_MAX).

 (2) Move pde_unload_lock two places further on so that if it's four bytes in
     size on a 64-bit machine, it won't cause an unused hole in the PDE struct.

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>fix leak in proc_set_super()</title>
<updated>2011-06-12T21:45:28Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2011-06-12T13:42:17Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff78fca2a03c08436535d3f7152a30752d8131d1'/>
<id>urn:sha1:ff78fca2a03c08436535d3f7152a30752d8131d1</id>
<content type='text'>
set_anon_super() can fail...

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>procfs: kill the global proc_mnt variable</title>
<updated>2011-03-24T02:46:58Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@redhat.com</email>
</author>
<published>2011-03-23T23:43:14Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=52e9fc76d0d4b1e8adeee736172c6c23180059b2'/>
<id>urn:sha1:52e9fc76d0d4b1e8adeee736172c6c23180059b2</id>
<content type='text'>
After the previous cleanup in proc_get_sb() the global proc_mnt has no
reasons to exists, kill it.

Signed-off-by: Oleg Nesterov &lt;oleg@redhat.com&gt;
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@free.fr&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Serge E. Hallyn &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>pidns: call pid_ns_prepare_proc() from create_pid_namespace()</title>
<updated>2011-03-24T02:46:58Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2011-03-23T23:43:13Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=4308eebbeb2026827d4492ce8c23d99f7f144a82'/>
<id>urn:sha1:4308eebbeb2026827d4492ce8c23d99f7f144a82</id>
<content type='text'>
Reorganize proc_get_sb() so it can be called before the struct pid of the
first process is allocated.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Signed-off-by: Daniel Lezcano &lt;daniel.lezcano@free.fr&gt;
Cc: Oleg Nesterov &lt;oleg@redhat.com&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Acked-by: Serge E. Hallyn &lt;serge@hallyn.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>switch procfs to -&gt;mount()</title>
<updated>2010-10-29T08:17:01Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2010-07-26T09:12:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=aed1d84f98738bcc1c605e1ff442de9890441315'/>
<id>urn:sha1:aed1d84f98738bcc1c605e1ff442de9890441315</id>
<content type='text'>
Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
<entry>
<title>setting -&gt;proc_mnt doesn't belong in proc_get_sb()</title>
<updated>2010-10-29T08:16:58Z</updated>
<author>
<name>Al Viro</name>
<email>viro@zeniv.linux.org.uk</email>
</author>
<published>2010-07-26T09:09:36Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=579441a39bbbbc408acd5b228d63e76cff708fe6'/>
<id>urn:sha1:579441a39bbbbc408acd5b228d63e76cff708fe6</id>
<content type='text'>
take that to kern_mount_data()-using callers

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
</content>
</entry>
</feed>
