<feed xmlns='http://www.w3.org/2005/Atom'>
<title>kernel.git/fs/proc/internal.h, branch linux-2.6.25.y</title>
<subtitle>Hosts the 0x221E linux distro kernel.
</subtitle>
<id>https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.25.y</id>
<link rel='self' href='https://git.0xinfinity.dev/distro/kernel.git/atom?h=linux-2.6.25.y'/>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/'/>
<updated>2008-03-07T19:08:40Z</updated>
<entry>
<title>[NET]: Make /proc/net a symlink on /proc/self/net (v3)</title>
<updated>2008-03-07T19:08:40Z</updated>
<author>
<name>Pavel Emelyanov</name>
</author>
<published>2008-03-07T19:08:40Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e9720acd728a46cb40daa52c99a979f7c4ff195c'/>
<id>urn:sha1:e9720acd728a46cb40daa52c99a979f7c4ff195c</id>
<content type='text'>
Current /proc/net is done with so called "shadows", but current
implementation is broken and has little chances to get fixed.

The problem is that dentries subtree of /proc/net directory has
fancy revalidation rules to make processes living in different
net namespaces see different entries in /proc/net subtree, but
currently, tasks see in the /proc/net subdir the contents of any
other namespace, depending on who opened the file first.

The proposed fix is to turn /proc/net into a symlink, which points
to /proc/self/net, which in turn shows what previously was in
/proc/net - the network-related info, from the net namespace the
appropriate task lives in.

# ls -l /proc/net
lrwxrwxrwx  1 root root 8 Mar  5 15:17 /proc/net -&gt; self/net

In other words - this behaves like /proc/mounts, but unlike
"mounts", "net" is not a file, but a directory.

Changes from v2:
* Fixed discrepancy of /proc/net nlink count and selinux labeling
  screwup pointed out by Stephen.

  To get the correct nlink count the -&gt;getattr callback for /proc/net
  is overridden to read one from the net-&gt;proc_net entry.

  To make selinux still work the net-&gt;proc_net entry is initialized
  properly, i.e. with the "net" name and the proc_net parent.

Selinux fixes are
Acked-by:  Stephen Smalley &lt;sds@tycho.nsa.gov&gt;

Changes from v1:
* Fixed a task_struct leak in get_proc_task_net, pointed out by Paul.

Signed-off-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Acked-by: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: David S. Miller &lt;davem@davemloft.net&gt;
</content>
</entry>
<entry>
<title>d_path: Make proc_get_link() use a struct path argument</title>
<updated>2008-02-15T05:17:08Z</updated>
<author>
<name>Jan Blunck</name>
</author>
<published>2008-02-15T03:38:35Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=3dcd25f37cfe2943beca93f41f50994108248a60'/>
<id>urn:sha1:3dcd25f37cfe2943beca93f41f50994108248a60</id>
<content type='text'>
proc_get_link() is always called with a dentry and a vfsmount from a struct
path.  Make proc_get_link() take it directly as an argument.

Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: "J. Bruce Fields" &lt;bfields@fieldses.org&gt;
Cc: Neil Brown &lt;neilb@suse.de&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.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>proc: seqfile convert proc_pid_status to properly handle pid namespaces</title>
<updated>2008-02-08T17:22:24Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2008-02-08T12:18:33Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=df5f8314ca30d6a76735748e5ba4ca9809c0f434'/>
<id>urn:sha1:df5f8314ca30d6a76735748e5ba4ca9809c0f434</id>
<content type='text'>
Currently we possibly lookup the pid in the wrong pid namespace.  So
seq_file convert proc_pid_status which ensures the proper pid namespaces is
passed in.

[akpm@linux-foundation.org: coding-style fixes]
[akpm@linux-foundation.org: build fix]
[akpm@linux-foundation.org: another build fix]
[akpm@linux-foundation.org: s390 build fix]
[akpm@linux-foundation.org: fix task_name() output]
[akpm@linux-foundation.org: fix nommu build]
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Andrew Morgan &lt;morgan@kernel.org&gt;
Cc: Serge Hallyn &lt;serue@us.ibm.com&gt;
Cc: Cedric Le Goater &lt;clg@fr.ibm.com&gt;
Cc: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Martin Schwidefsky &lt;schwidefsky@de.ibm.com&gt;
Cc: Heiko Carstens &lt;heiko.carstens@de.ibm.com&gt;
Cc: Paul Menage &lt;menage@google.com&gt;
Cc: Paul Jackson &lt;pj@sgi.com&gt;
Cc: David Rientjes &lt;rientjes@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>seqfile convert proc_pid_statm</title>
<updated>2008-02-08T17:22:24Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2008-02-08T12:18:32Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=a56d3fc74c0178c5f41c48315604d62cff4e746d'/>
<id>urn:sha1:a56d3fc74c0178c5f41c48315604d62cff4e746d</id>
<content type='text'>
This conversion is just for code cleanliness, uniformity, and general safety.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.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>proc: rewrite do_task_stat to correctly handle pid namespaces.</title>
<updated>2008-02-08T17:22:23Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2008-02-08T12:18:31Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=ee992744ea53db0a90c986fd0a70fbbf91e7f8bd'/>
<id>urn:sha1:ee992744ea53db0a90c986fd0a70fbbf91e7f8bd</id>
<content type='text'>
Currently (as pointed out by Oleg) do_task_stat has a race when calling
task_pid_nr_ns with the task exiting.  In addition do_task_stat is not
currently displaying information in the context of the pid namespace that
mounted the /proc filesystem.  So "cut -d' ' -f 1 /proc/&lt;pid&gt;/stat" may not
equal &lt;pid&gt;.

This patch fixes the problem by converting to a single_open seq_file show
method.  Getting the pid namespace from the filesystem superblock instead of
current, and simply using the the struct pid from the inode instead of
attempting to get that same pid from the task.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Alexey Dobriyan &lt;adobriyan@gmail.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>maps4: add /proc/pid/pagemap interface</title>
<updated>2008-02-05T17:44:16Z</updated>
<author>
<name>Matt Mackall</name>
</author>
<published>2008-02-05T06:29:04Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=85863e475e59afb027b0113290e3796ee6020b7d'/>
<id>urn:sha1:85863e475e59afb027b0113290e3796ee6020b7d</id>
<content type='text'>
This interface provides a mapping for each page in an address space to its
physical page frame number, allowing precise determination of what pages are
mapped and what pages are shared between processes.

New in this version:

- headers gone again (as recommended by Dave Hansen and Alan Cox)
- 64-bit entries (as per discussion with Andi Kleen)
- swap pte information exported (from Dave Hansen)
- page walker callback for holes (from Dave Hansen)
- direct put_user I/O (as suggested by Rusty Russell)

This patch folds in cleanups and swap PTE support from Dave Hansen
&lt;haveblue@us.ibm.com&gt;.

Signed-off-by: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Dave Hansen &lt;haveblue@us.ibm.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>maps4: move clear_refs code to task_mmu.c</title>
<updated>2008-02-05T17:44:16Z</updated>
<author>
<name>Matt Mackall</name>
</author>
<published>2008-02-05T06:29:03Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=f248dcb34d7b7ac255db70071a20be9d9c6ad491'/>
<id>urn:sha1:f248dcb34d7b7ac255db70071a20be9d9c6ad491</id>
<content type='text'>
This puts all the clear_refs code where it belongs and probably lets things
compile on MMU-less systems as well.

Signed-off-by: Matt Mackall &lt;mpm@selenic.com&gt;
Cc: Jeremy Fitzhardinge &lt;jeremy@goop.org&gt;
Cc: David Rientjes &lt;rientjes@google.com&gt;
Cc: Dave Hansen &lt;haveblue@us.ibm.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>restrict reading from /proc/&lt;pid&gt;/maps to those who share -&gt;mm or can ptrace pid</title>
<updated>2008-01-02T21:13:27Z</updated>
<author>
<name>Al Viro</name>
</author>
<published>2008-01-02T14:09:57Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=831830b5a2b5d413407adf380ef62fe17d6fcbf2'/>
<id>urn:sha1:831830b5a2b5d413407adf380ef62fe17d6fcbf2</id>
<content type='text'>
Contents of /proc/*/maps is sensitive and may become sensitive after
open() (e.g.  if target originally shares our -&gt;mm and later does exec
on suid-root binary).

Check at read() (actually, -&gt;start() of iterator) time that mm_struct
we'd grabbed and locked is
 - still the -&gt;mm of target
 - equal to reader's -&gt;mm or the target is ptracable by reader.

Signed-off-by: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Acked-by: Rik van Riel &lt;riel@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>proc: fix NULL -&gt;i_fop oops</title>
<updated>2007-11-29T17:24:52Z</updated>
<author>
<name>Alexey Dobriyan</name>
</author>
<published>2007-11-29T00:21:23Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=c2319540cd7330fa9066e5b9b84d357a2c8631a2'/>
<id>urn:sha1:c2319540cd7330fa9066e5b9b84d357a2c8631a2</id>
<content type='text'>
proc_kill_inodes() can clear -&gt;i_fop in the middle of vfs_readdir resulting in
NULL dereference during "file-&gt;f_op-&gt;readdir(file, buf, filler)".

The solution is to remove proc_kill_inodes() completely:

a) we don't have tricky modules implementing their tricky readdir hooks which
   could keeping this revoke from hell.

b) In a situation when module is gone but PDE still alive, standard
   readdir will return only "." and "..", because pde-&gt;next was cleared by
   remove_proc_entry().

c) the race proc_kill_inode() destined to prevent is not completely
   fixed, just race window made smaller, because vfs_readdir() is run
   without sb_lock held and without file_list_lock held.  Effectively,
   -&gt;i_fop is cleared at random moment, which can't fix properly anything.

BUG: unable to handle kernel NULL pointer dereference at virtual address 00000018
printing eip: c1061205 *pdpt = 0000000005b22001 *pde = 0000000000000000
Oops: 0000 [#1] PREEMPT SMP
Modules linked in: foo af_packet ipv6 cpufreq_ondemand loop serio_raw sr_mod k8temp cdrom hwmon amd_rng
Pid: 2033, comm: find Not tainted (2.6.24-rc1-b1d08ac064268d0ae2281e98bf5e82627e0f0c56 #2)
EIP: 0060:[&lt;c1061205&gt;] EFLAGS: 00010246 CPU: 0
EIP is at vfs_readdir+0x47/0x74
EAX: c6b6a780 EBX: 00000000 ECX: c1061040 EDX: c5decf94
ESI: c6b6a780 EDI: fffffffe EBP: c9797c54 ESP: c5decf78
 DS: 007b ES: 007b FS: 00d8 GS: 0033 SS: 0068
Process find (pid: 2033, ti=c5dec000 task=c64bba90 task.ti=c5dec000)
Stack: c5decf94 c1061040 fffffff7 0805ffbc 00000000 c6b6a780 c1061295 0805ffbc
       00000000 00000400 00000000 00000004 0805ffbc 4588eff4 c5dec000 c10026ba
       00000004 0805ffbc 00000400 0805ffbc 4588eff4 bfdc6c70 000000dc 0000007b
Call Trace:
 [&lt;c1061040&gt;] filldir64+0x0/0xc5
 [&lt;c1061295&gt;] sys_getdents64+0x63/0xa5
 [&lt;c10026ba&gt;] sysenter_past_esp+0x5f/0x85
 =======================
Code: 49 83 78 18 00 74 43 8d 6b 74 bf fe ff ff ff 89 e8 e8 b8 c0 12 00 f6 83 2c 01 00 00 10 75 22 8b 5e 10 8b 4c 24 04 89 f0 8b 14 24 &lt;ff&gt; 53 18 f6 46 1a 04 89 c7 75 0b 8b 56 0c 8b 46 08 e8 c8 66 00
EIP: [&lt;c1061205&gt;] vfs_readdir+0x47/0x74 SS:ESP 0068:c5decf78

hch: "Nice, getting rid of this is a very good step formwards.
      Unfortunately we have another copy of this junk in
      security/selinux/selinuxfs.c:sel_remove_entries() which would need the
      same treatment."

Signed-off-by: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Acked-by: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Al Viro &lt;viro@zeniv.linux.org.uk&gt;
Cc: Stephen Smalley &lt;sds@tycho.nsa.gov&gt;
Cc: James Morris &lt;jmorris@namei.org&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.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>proc: fix proc_kill_inodes to kill dentries on all proc superblocks</title>
<updated>2007-11-15T02:45:38Z</updated>
<author>
<name>Eric W. Biederman</name>
</author>
<published>2007-11-15T00:59:08Z</published>
<link rel='alternate' type='text/html' href='https://git.0xinfinity.dev/distro/kernel.git/commit/?id=e1a1c997afe907e6ec4799e4be0f38cffd8b418c'/>
<id>urn:sha1:e1a1c997afe907e6ec4799e4be0f38cffd8b418c</id>
<content type='text'>
It appears we overlooked support for removing generic proc files
when we added support for multiple proc super blocks.  Handle
that now.

[akpm@linux-foundation.org: coding-style cleanups]
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Acked-by: Pavel Emelyanov &lt;xemul@openvz.org&gt;
Cc: Alexey Dobriyan &lt;adobriyan@sw.ru&gt;
Acked-by: Sukadev Bhattiprolu &lt;sukadev@us.ibm.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>
</feed>
