<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux/kernel, branch v2.6.35</title>
<subtitle>Linux kernel source tree</subtitle>
<id>https://git.amat.us/linux/atom/kernel?h=v2.6.35</id>
<link rel='self' href='https://git.amat.us/linux/atom/kernel?h=v2.6.35'/>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/'/>
<updated>2010-07-29T22:16:17Z</updated>
<entry>
<title>CRED: Fix get_task_cred() and task_state() to not resurrect dead credentials</title>
<updated>2010-07-29T22:16:17Z</updated>
<author>
<name>David Howells</name>
<email>dhowells@redhat.com</email>
</author>
<published>2010-07-29T11:45:49Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=de09a9771a5346029f4d11e4ac886be7f9bfdd75'/>
<id>urn:sha1:de09a9771a5346029f4d11e4ac886be7f9bfdd75</id>
<content type='text'>
It's possible for get_task_cred() as it currently stands to 'corrupt' a set of
credentials by incrementing their usage count after their replacement by the
task being accessed.

What happens is that get_task_cred() can race with commit_creds():

	TASK_1			TASK_2			RCU_CLEANER
	--&gt;get_task_cred(TASK_2)
	rcu_read_lock()
	__cred = __task_cred(TASK_2)
				--&gt;commit_creds()
				old_cred = TASK_2-&gt;real_cred
				TASK_2-&gt;real_cred = ...
				put_cred(old_cred)
				  call_rcu(old_cred)
		[__cred-&gt;usage == 0]
	get_cred(__cred)
		[__cred-&gt;usage == 1]
	rcu_read_unlock()
							--&gt;put_cred_rcu()
							[__cred-&gt;usage == 1]
							panic()

However, since a tasks credentials are generally not changed very often, we can
reasonably make use of a loop involving reading the creds pointer and using
atomic_inc_not_zero() to attempt to increment it if it hasn't already hit zero.

If successful, we can safely return the credentials in the knowledge that, even
if the task we're accessing has released them, they haven't gone to the RCU
cleanup code.

We then change task_state() in procfs to use get_task_cred() rather than
calling get_cred() on the result of __task_cred(), as that suffers from the
same problem.

Without this change, a BUG_ON in __put_cred() or in put_cred_rcu() can be
tripped when it is noticed that the usage count is not zero as it ought to be,
for example:

kernel BUG at kernel/cred.c:168!
invalid opcode: 0000 [#1] SMP
last sysfs file: /sys/kernel/mm/ksm/run
CPU 0
Pid: 2436, comm: master Not tainted 2.6.33.3-85.fc13.x86_64 #1 0HR330/OptiPlex
745
RIP: 0010:[&lt;ffffffff81069881&gt;]  [&lt;ffffffff81069881&gt;] __put_cred+0xc/0x45
RSP: 0018:ffff88019e7e9eb8  EFLAGS: 00010202
RAX: 0000000000000001 RBX: ffff880161514480 RCX: 00000000ffffffff
RDX: 00000000ffffffff RSI: ffff880140c690c0 RDI: ffff880140c690c0
RBP: ffff88019e7e9eb8 R08: 00000000000000d0 R09: 0000000000000000
R10: 0000000000000001 R11: 0000000000000040 R12: ffff880140c690c0
R13: ffff88019e77aea0 R14: 00007fff336b0a5c R15: 0000000000000001
FS:  00007f12f50d97c0(0000) GS:ffff880007400000(0000) knlGS:0000000000000000
CS:  0010 DS: 0000 ES: 0000 CR0: 0000000080050033
CR2: 00007f8f461bc000 CR3: 00000001b26ce000 CR4: 00000000000006f0
DR0: 0000000000000000 DR1: 0000000000000000 DR2: 0000000000000000
DR3: 0000000000000000 DR6: 00000000ffff0ff0 DR7: 0000000000000400
Process master (pid: 2436, threadinfo ffff88019e7e8000, task ffff88019e77aea0)
Stack:
 ffff88019e7e9ec8 ffffffff810698cd ffff88019e7e9ef8 ffffffff81069b45
&lt;0&gt; ffff880161514180 ffff880161514480 ffff880161514180 0000000000000000
&lt;0&gt; ffff88019e7e9f28 ffffffff8106aace 0000000000000001 0000000000000246
Call Trace:
 [&lt;ffffffff810698cd&gt;] put_cred+0x13/0x15
 [&lt;ffffffff81069b45&gt;] commit_creds+0x16b/0x175
 [&lt;ffffffff8106aace&gt;] set_current_groups+0x47/0x4e
 [&lt;ffffffff8106ac89&gt;] sys_setgroups+0xf6/0x105
 [&lt;ffffffff81009b02&gt;] system_call_fastpath+0x16/0x1b
Code: 48 8d 71 ff e8 7e 4e 15 00 85 c0 78 0b 8b 75 ec 48 89 df e8 ef 4a 15 00
48 83 c4 18 5b c9 c3 55 8b 07 8b 07 48 89 e5 85 c0 74 04 &lt;0f&gt; 0b eb fe 65 48 8b
04 25 00 cc 00 00 48 3b b8 58 04 00 00 75
RIP  [&lt;ffffffff81069881&gt;] __put_cred+0xc/0x45
 RSP &lt;ffff88019e7e9eb8&gt;
---[ end trace df391256a100ebdd ]---

Signed-off-by: David Howells &lt;dhowells@redhat.com&gt;
Acked-by: Jiri Olsa &lt;jolsa@redhat.com&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>dynamic debug: move ddebug_remove_module() down into free_module()</title>
<updated>2010-07-27T21:32:06Z</updated>
<author>
<name>Jason Baron</name>
<email>jbaron@redhat.com</email>
</author>
<published>2010-07-27T20:18:01Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b82bab4bbe9efa7bc7177fc20620fff19bd95484'/>
<id>urn:sha1:b82bab4bbe9efa7bc7177fc20620fff19bd95484</id>
<content type='text'>
The command

	echo "file ec.c +p" &gt;/sys/kernel/debug/dynamic_debug/control

causes an oops.

Move the call to ddebug_remove_module() down into free_module().  In this
way it should be called from all error paths.  Currently, we are missing
the remove if the module init routine fails.

Signed-off-by: Jason Baron &lt;jbaron@redhat.com&gt;
Reported-by: Thomas Renninger &lt;trenn@suse.de&gt;
Tested-by: Thomas Renninger &lt;trenn@suse.de&gt;
Cc: &lt;stable@kernel.org&gt;		[2.6.32+]
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>sysrq,kdb: Use __handle_sysrq() for kdb's sysrq function</title>
<updated>2010-07-22T00:27:07Z</updated>
<author>
<name>Jason Wessel</name>
<email>jason.wessel@windriver.com</email>
</author>
<published>2010-07-22T00:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=edd63cb6b91024332d6983fc51058ac1ef0c081e'/>
<id>urn:sha1:edd63cb6b91024332d6983fc51058ac1ef0c081e</id>
<content type='text'>
The kdb code should not toggle the sysrq state in case an end user
wants to try and resume the normal kernel execution.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Acked-by: Dmitry Torokhov &lt;dmitry.torokhov@gmail.com&gt;
</content>
</entry>
<entry>
<title>debug_core,kdb: fix kgdb_connected bit set in the wrong place</title>
<updated>2010-07-22T00:27:07Z</updated>
<author>
<name>Jason Wessel</name>
<email>jason.wessel@windriver.com</email>
</author>
<published>2010-07-22T00:27:07Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=b0679c63db655fa12007558e267bc0eb1d486fdb'/>
<id>urn:sha1:b0679c63db655fa12007558e267bc0eb1d486fdb</id>
<content type='text'>
Immediately following an exit from the kdb shell the kgdb_connected
variable should be set to zero, unless there are breakpoints planted.
If the kgdb_connected variable is not zeroed out with kdb, it is
impossible to turn off kdb.

This patch is merely a work around for now, the real fix will check
for the breakpoints.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>Fix merge regression from external kdb to upstream kdb</title>
<updated>2010-07-22T00:27:06Z</updated>
<author>
<name>Jason Wessel</name>
<email>jason.wessel@windriver.com</email>
</author>
<published>2010-07-22T00:27:06Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9e8b624fcaebf9c237b5be9116f4424bf168e6d1'/>
<id>urn:sha1:9e8b624fcaebf9c237b5be9116f4424bf168e6d1</id>
<content type='text'>
In the process of merging kdb to the mainline, the kdb lsmod command
stopped printing the base load address of kernel modules.  This is
needed for using kdb in conjunction with external tools such as gdb.

Simply restore the functionality by adding a kdb_printf for the base
load address of the kernel modules.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>repair gdbstub to match the gdbserial protocol specification</title>
<updated>2010-07-22T00:27:05Z</updated>
<author>
<name>Jason Wessel</name>
<email>jason.wessel@windriver.com</email>
</author>
<published>2010-07-22T00:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=fb82c0ff27b2c40c6f7a3d1a94cafb154591fa80'/>
<id>urn:sha1:fb82c0ff27b2c40c6f7a3d1a94cafb154591fa80</id>
<content type='text'>
The gdbserial protocol handler should return an empty packet instead
of an error string when ever it responds to a command it does not
implement.

The problem cases come from a debugger client sending
qTBuffer, qTStatus, qSearch, qSupported.

The incorrect response from the gdbstub leads the debugger clients to
not function correctly.  Recent versions of gdb will not detach correctly as a result of this behavior.

Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
Signed-off-by: Dongdong Deng &lt;dongdong.deng@windriver.com&gt;
</content>
</entry>
<entry>
<title>kdb: break out of kdb_ll() when command is terminated</title>
<updated>2010-07-22T00:27:05Z</updated>
<author>
<name>Martin Hicks</name>
<email>mort@sgi.com</email>
</author>
<published>2010-07-22T00:27:05Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=1396a21ba0d4ec381db19bc9cd5b6f25a89cf633'/>
<id>urn:sha1:1396a21ba0d4ec381db19bc9cd5b6f25a89cf633</id>
<content type='text'>
Without this patch the "ll" linked-list traversal command won't
terminate when you hit q/Q.

Signed-off-by: Martin Hicks &lt;mort@sgi.com&gt;
Signed-off-by: Jason Wessel &lt;jason.wessel@windriver.com&gt;
</content>
</entry>
<entry>
<title>kmemleak: Add support for NO_BOOTMEM configurations</title>
<updated>2010-07-19T10:54:15Z</updated>
<author>
<name>Catalin Marinas</name>
<email>catalin.marinas@arm.com</email>
</author>
<published>2010-07-19T10:54:15Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=9078370c0d2cfe4a905aa34f398bbb0d65921a2b'/>
<id>urn:sha1:9078370c0d2cfe4a905aa34f398bbb0d65921a2b</id>
<content type='text'>
With commits 08677214 and 59be5a8e, alloc_bootmem()/free_bootmem() and
friends use the early_res functions for memory management when
NO_BOOTMEM is enabled. This patch adds the kmemleak calls in the
corresponding code paths for bootmem allocations.

Signed-off-by: Catalin Marinas &lt;catalin.marinas@arm.com&gt;
Acked-by: Pekka Enberg &lt;penberg@cs.helsinki.fi&gt;
Acked-by: Yinghai Lu &lt;yinghai@kernel.org&gt;
Cc: H. Peter Anvin &lt;hpa@zytor.com&gt;
Cc: stable@kernel.org
</content>
</entry>
<entry>
<title>module: initialize module dynamic debug later</title>
<updated>2010-07-05T03:17:22Z</updated>
<author>
<name>Yehuda Sadeh</name>
<email>yehuda@hq.newdream.net</email>
</author>
<published>2010-07-03T03:07:35Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=ff49d74ad383f54041378144ca1a229ee9aeaa59'/>
<id>urn:sha1:ff49d74ad383f54041378144ca1a229ee9aeaa59</id>
<content type='text'>
We should initialize the module dynamic debug datastructures
only after determining that the module is not loaded yet. This
fixes a bug that introduced in 2.6.35-rc2, where when a trying
to load a module twice, we also load it's dynamic printing data
twice which causes all sorts of nasty issues. Also handle
the dynamic debug cleanup later on failure.

Signed-off-by: Yehuda Sadeh &lt;yehuda@hq.newdream.net&gt;
Signed-off-by: Rusty Russell &lt;rusty@rustcorp.com.au&gt; (removed a #ifdef)
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
</entry>
<entry>
<title>Merge branch 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip</title>
<updated>2010-07-02T16:52:58Z</updated>
<author>
<name>Linus Torvalds</name>
<email>torvalds@linux-foundation.org</email>
</author>
<published>2010-07-02T16:52:58Z</published>
<link rel='alternate' type='text/html' href='https://git.amat.us/linux/commit/?id=123f94f22e3d283dfe68742b269c245b0501ad82'/>
<id>urn:sha1:123f94f22e3d283dfe68742b269c245b0501ad82</id>
<content type='text'>
* 'sched-fixes-for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/tip/linux-2.6-tip:
  sched: Cure nr_iowait_cpu() users
  init: Fix comment
  init, sched: Fix race between init and kthreadd
</content>
</entry>
</feed>
