<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/fs/proc, branch v2.6.19</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/fs/proc?h=v2.6.19</id>
<link rel='self' href='https://git.amat.us/linux/atom/fs/proc?h=v2.6.19'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2006-11-25T21:28:33Z</updated>
<entry>
<title>[PATCH] mounstats NULL pointer dereference</title>
<updated>2006-11-25T21:28:33Z</updated>
<author>
<name>Vasily Tarasov</name>
<email>vtaras@openvz.org</email>
</author>
<published>2006-11-25T19:09:22Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=701e054e0c2db82359f0454c7ed4fd24346d52eb'/>
<id>urn:sha1:701e054e0c2db82359f0454c7ed4fd24346d52eb</id>
<content type='text'>
OpenVZ developers team has encountered the following problem in 2.6.19-rc6
kernel. After some seconds of running script

while [[ 1 ]]
do
	find  /proc -name mountstats | xargs cat
done

this Oops appears:

BUG: unable to handle kernel NULL pointer dereference at virtual address
00000010
 printing eip:
c01a6b70
*pde = 00000000
Oops: 0000 [#1]
SMP
Modules linked in: xt_length ipt_ttl xt_tcpmss ipt_TCPMSS iptable_mangle
iptable_filter xt_multiport xt_limit ipt_tos ipt_REJECT ip_tables x_tables
parport_pc lp parport sunrpc af_packet thermal processor fan button battery
asus_acpi ac ohci_hcd ehci_hcd usbcore i2c_nforce2 i2c_core tg3 floppy
pata_amd
ide_cd cdrom sata_nv libata
CPU:    1
EIP:    0060:[&lt;c01a6b70&gt;]    Not tainted VLI
EFLAGS: 00010246   (2.6.19-rc6 #2)
EIP is at mountstats_open+0x70/0xf0
eax: 00000000   ebx: e6247030   ecx: e62470f8   edx: 00000000
esi: 00000000   edi: c01a6b00   ebp: c33b83c0   esp: f4105eb4
ds: 007b   es: 007b   ss: 0068
Process cat (pid: 6044, ti=f4105000 task=f4104a70 task.ti=f4105000)
Stack: c33b83c0 c04ee940 f46a4a80 c33b83c0 e4df31b4 c01a6b00 f4105000 c0169231
       e4df31b4 c33b83c0 c33b83c0 f4105f20 00000003 f4105000 c0169445 f2503cf0
       f7f8c4c0 00008000 c33b83c0 00000000 00008000 c0169350 f4105f20 00008000
Call Trace:
 [&lt;c01a6b00&gt;] mountstats_open+0x0/0xf0
 [&lt;c0169231&gt;] __dentry_open+0x181/0x250
 [&lt;c0169445&gt;] nameidata_to_filp+0x35/0x50
 [&lt;c0169350&gt;] do_filp_open+0x50/0x60
 [&lt;c01873d6&gt;] seq_read+0xc6/0x300
 [&lt;c0169511&gt;] get_unused_fd+0x31/0xc0
 [&lt;c01696d3&gt;] do_sys_open+0x63/0x110
 [&lt;c01697a7&gt;] sys_open+0x27/0x30
 [&lt;c01030bd&gt;] sysenter_past_esp+0x56/0x79
 =======================
Code: 45 74 8b 54 24 20 89 44 24 08 8b 42 f0 31 d2 e8 47 cb f8 ff 85 c0 89 c3
74 51 8d 80 a0 04 00 00 e8 46 06 2c 00 8b 83 48 04 00 00 &lt;8b&gt; 78 10 85 ff 74
03
f0 ff 07 b0 01 86 83 a0 04 00 00 f0 ff 4b
EIP: [&lt;c01a6b70&gt;] mountstats_open+0x70/0xf0 SS:ESP 0068:f4105eb4

The problem is that task-&gt;nsproxy can be equal NULL for some time during
task exit. This patch fixes the BUG.

Signed-off-by: Vasily Tarasov &lt;vtaras@openvz.org&gt;
Cc: Herbert Poetzl &lt;herbert@13thfloor.at&gt;
Cc: "Serge E. Hallyn" &lt;serue@us.ibm.com&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] OOM killer meets userspace headers</title>
<updated>2006-10-20T17:26:38Z</updated>
<author>
<name>Alexey Dobriyan</name>
<email>adobriyan@gmail.com</email>
</author>
<published>2006-10-20T06:28:32Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8ac773b4f73afa6fd66695131103944b975d5d5c'/>
<id>urn:sha1:8ac773b4f73afa6fd66695131103944b975d5d5c</id>
<content type='text'>
Despite mm.h is not being exported header, it does contain one thing
which is part of userspace ABI -- value disabling OOM killer for given
process. So,
a) create and export include/linux/oom.h
b) move OOM_DISABLE define there.
c) turn bounding values of /proc/$PID/oom_adj into defines and export
   them too.

Note: mass __KERNEL__ removal will be done later.

Signed-off-by: Alexey Dobriyan &lt;adobriyan@gmail.com&gt;
Cc: Nick Piggin &lt;nickpiggin@yahoo.com.au&gt;
Cc: David Woodhouse &lt;dwmw2@infradead.org&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] PROC_NUMBUF is wrong</title>
<updated>2006-10-17T15:18:43Z</updated>
<author>
<name>Andrew Morton</name>
<email>akpm@osdl.org</email>
</author>
<published>2006-10-17T07:09:41Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=0187f879ee8d4b914e74ffa3cc5df268311fc2d2'/>
<id>urn:sha1:0187f879ee8d4b914e74ffa3cc5df268311fc2d2</id>
<content type='text'>
Actually, the decimal representation of a 32-bit signed number can take 12
bytes, including the \0.

And then some code adds a \n as well, so let's give it 13 bytes.

Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>IRQ: Maintain regs pointer globally rather than passing to IRQ handlers</title>
<updated>2006-10-05T14:10:12Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2006-10-05T13:55:46Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7d12e780e003f93433d49ce78cfedf4b4c52adc5'/>
<id>urn:sha1:7d12e780e003f93433d49ce78cfedf4b4c52adc5</id>
<content type='text'>
Maintain a per-CPU global "struct pt_regs *" variable which can be used instead
of passing regs around manually through all ~1800 interrupt handlers in the
Linux kernel.

The regs pointer is used in few places, but it potentially costs both stack
space and code to pass it around.  On the FRV arch, removing the regs parameter
from all the genirq function results in a 20% speed up of the IRQ exit path
(ie: from leaving timer_interrupt() to leaving do_IRQ()).

Where appropriate, an arch may override the generic storage facility and do
something different with the variable.  On FRV, for instance, the address is
maintained in GR28 at all times inside the kernel as part of general exception
handling.

Having looked over the code, it appears that the parameter may be handed down
through up to twenty or so layers of functions.  Consider a USB character
device attached to a USB hub, attached to a USB controller that posts its
interrupts through a cascaded auxiliary interrupt controller.  A character
device driver may want to pass regs to the sysrq handler through the input
layer which adds another few layers of parameter passing.

I've build this code with allyesconfig for x86_64 and i386.  I've runtested the
main part of the code on FRV and i386, though I can't test most of the drivers.
I've also done partial conversion for powerpc and MIPS - these at least compile
with minimal configurations.

This will affect all archs.  Mostly the changes should be relatively easy.
Take do_IRQ(), store the regs pointer at the beginning, saving the old one:

	struct pt_regs *old_regs = set_irq_regs(regs);

And put the old one back at the end:

	set_irq_regs(old_regs);

Don't pass regs through to generic_handle_irq() or __do_IRQ().

In timer_interrupt(), this sort of change will be necessary:

	-	update_process_times(user_mode(regs));
	-	profile_tick(CPU_PROFILING, regs);
	+	update_process_times(user_mode(get_irq_regs()));
	+	profile_tick(CPU_PROFILING);

I'd like to move update_process_times()'s use of get_irq_regs() into itself,
except that i386, alone of the archs, uses something other than user_mode().

Some notes on the interrupt handling in the drivers:

 (*) input_dev() is now gone entirely.  The regs pointer is no longer stored in
     the input_dev struct.

 (*) finish_unlinks() in drivers/usb/host/ohci-q.c needs checking.  It does
     something different depending on whether it's been supplied with a regs
     pointer or not.

 (*) Various IRQ handler function pointers have been moved to type
     irq_handler_t.

Signed-Off-By: David Howells &lt;dhowells@redhat.com&gt;
(cherry picked from 1b16e7ac850969f38b375e511e3fa2f474a33867 commit)
</content>
</entry>
<entry>
<title>[PATCH] introduce get_task_pid() to fix unsafe get_pid()</title>
<updated>2006-10-02T14:57:25Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-10-02T09:18:59Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1a657f78dcc8ea7c53eaa1f2a45ea2315738c15f'/>
<id>urn:sha1:1a657f78dcc8ea7c53eaa1f2a45ea2315738c15f</id>
<content type='text'>
proc_pid_make_inode:

	ei-&gt;pid = get_pid(task_pid(task));

I think this is not safe.  get_pid() can be preempted after checking "pid
!= NULL".  Then the task exits, does detach_pid(), and RCU frees the pid.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] proc: comment what proc_fill_cache does</title>
<updated>2006-10-02T14:57:25Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-10-02T09:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1c0d04c9e44f4a248335c33d2be7c7f7b06ff359'/>
<id>urn:sha1:1c0d04c9e44f4a248335c33d2be7c7f7b06ff359</id>
<content type='text'>
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] proc: remove the useless SMP-safe comments from /proc</title>
<updated>2006-10-02T14:57:25Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-10-02T09:18:57Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=5e61feafa2c641c2a013ba94eec56c411011cc94'/>
<id>urn:sha1:5e61feafa2c641c2a013ba94eec56c411011cc94</id>
<content type='text'>
Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] proc: remove trailing blank entry from pid_entry arrays</title>
<updated>2006-10-02T14:57:25Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-10-02T09:18:56Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=7bcd6b0efd5216f2f208e92150b0e5b9bea2c210'/>
<id>urn:sha1:7bcd6b0efd5216f2f208e92150b0e5b9bea2c210</id>
<content type='text'>
It was pointed out that since I am taking ARRAY_SIZE anyway the trailing empty
entry is silly and just wastes space.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] proc: properly compute TGID_OFFSET</title>
<updated>2006-10-02T14:57:24Z</updated>
<author>
<name>Eric W. Biederman</name>
<email>ebiederm@xmission.com</email>
</author>
<published>2006-10-02T09:18:55Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=8e95bd936df2d3fc0e773068aa34350306a5c52a'/>
<id>urn:sha1:8e95bd936df2d3fc0e773068aa34350306a5c52a</id>
<content type='text'>
The value doesn't change but this ensures I will have the proper value when
other files are added to proc_base_stuff.

Signed-off-by: Eric W. Biederman &lt;ebiederm@xmission.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
<entry>
<title>[PATCH] proc: drop tasklist lock in task_state()</title>
<updated>2006-10-02T14:57:24Z</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-10-02T09:18:54Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b0fa9db6abdb2875a6d3069ddc6a2846a73fa5cd'/>
<id>urn:sha1:b0fa9db6abdb2875a6d3069ddc6a2846a73fa5cd</id>
<content type='text'>
task_state() needs tasklist_lock to protect -&gt;parent/-&gt;real_parent.  However
task-&gt;parent points to nowhere only when the actions below happen in order

	1) release_task(task)
	2) release_task(task-&gt;parent)
	3) a grace period passed

But 3) implies that the memory ops from 1) should be finished, so pid_alive()
can't be true in such a case.

Otherwise, we don't care if -&gt;parent/-&gt;real_parent changes under us.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
</entry>
</feed>
