<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/fs/exec.c, branch v2.6.18</title>
<subtitle>Linux kernel for Apalis and Colibri modules</subtitle>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/'/>
<entry>
<title>[PATCH] fix up lockdep trace in fs/exec.c</title>
<updated>2006-08-27T18:01:32+00:00</updated>
<author>
<name>Dave Jones</name>
<email>davej@redhat.com</email>
</author>
<published>2006-08-27T08:23:57+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=513627d7fec6fcb7b3d56ce355cb4d192c76b530'/>
<id>513627d7fec6fcb7b3d56ce355cb4d192c76b530</id>
<content type='text'>
This fixes the locking error noticed by lockdep:

  =============================================
  [ INFO: possible recursive locking detected ]
  ---------------------------------------------
  init/1 is trying to acquire lock:
   (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a78a&gt;] flush_old_exec+0x3ae/0x859

  but task is already holding lock:
   (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a77a&gt;] flush_old_exec+0x39e/0x859

  other info that might help us debug this:
  2 locks held by init/1:
   #0:  (tasklist_lock){..--}, at: [&lt;c047a76a&gt;] flush_old_exec+0x38e/0x859
   #1:  (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a77a&gt;] flush_old_exec+0x39e/0x859

  stack backtrace:
   [&lt;c04051e1&gt;] show_trace_log_lvl+0x54/0xfd
   [&lt;c040579d&gt;] show_trace+0xd/0x10
   [&lt;c04058b6&gt;] dump_stack+0x19/0x1b
   [&lt;c043b33a&gt;] __lock_acquire+0x773/0x997
   [&lt;c043bacf&gt;] lock_acquire+0x4b/0x6c
   [&lt;c060630b&gt;] _spin_lock+0x19/0x28
   [&lt;c047a78a&gt;] flush_old_exec+0x3ae/0x859
   [&lt;c0498053&gt;] load_elf_binary+0x4aa/0x1628
   [&lt;c0479cab&gt;] search_binary_handler+0xa7/0x24e
   [&lt;c047b577&gt;] do_execve+0x15b/0x1f9
   [&lt;c04022b4&gt;] sys_execve+0x29/0x4d
   [&lt;c0403faf&gt;] syscall_call+0x7/0xb

Signed-off-by: Arjan van de Ven &lt;arjan@infradead.org&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This fixes the locking error noticed by lockdep:

  =============================================
  [ INFO: possible recursive locking detected ]
  ---------------------------------------------
  init/1 is trying to acquire lock:
   (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a78a&gt;] flush_old_exec+0x3ae/0x859

  but task is already holding lock:
   (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a77a&gt;] flush_old_exec+0x39e/0x859

  other info that might help us debug this:
  2 locks held by init/1:
   #0:  (tasklist_lock){..--}, at: [&lt;c047a76a&gt;] flush_old_exec+0x38e/0x859
   #1:  (&amp;sighand-&gt;siglock){....}, at: [&lt;c047a77a&gt;] flush_old_exec+0x39e/0x859

  stack backtrace:
   [&lt;c04051e1&gt;] show_trace_log_lvl+0x54/0xfd
   [&lt;c040579d&gt;] show_trace+0xd/0x10
   [&lt;c04058b6&gt;] dump_stack+0x19/0x1b
   [&lt;c043b33a&gt;] __lock_acquire+0x773/0x997
   [&lt;c043bacf&gt;] lock_acquire+0x4b/0x6c
   [&lt;c060630b&gt;] _spin_lock+0x19/0x28
   [&lt;c047a78a&gt;] flush_old_exec+0x3ae/0x859
   [&lt;c0498053&gt;] load_elf_binary+0x4aa/0x1628
   [&lt;c0479cab&gt;] search_binary_handler+0xa7/0x24e
   [&lt;c047b577&gt;] do_execve+0x15b/0x1f9
   [&lt;c04022b4&gt;] sys_execve+0x29/0x4d
   [&lt;c0403faf&gt;] syscall_call+0x7/0xb

Signed-off-by: Arjan van de Ven &lt;arjan@infradead.org&gt;
Signed-off-by: Dave Jones &lt;davej@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>VFS: Remove redundant open-coded mode bit checks in open_exec().</title>
<updated>2006-08-24T19:55:16+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-08-23T00:06:04+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=a969fd5a4e162c4485ae8f3e49d674656a18fa36'/>
<id>a969fd5a4e162c4485ae8f3e49d674656a18fa36</id>
<content type='text'>
The check in open_exec() for inode-&gt;i_mode &amp; 0111 has been made
redundant by the fix to permission().

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 1d3741c5d991686699f100b65b9956f7ee7ae0ae commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The check in open_exec() for inode-&gt;i_mode &amp; 0111 has been made
redundant by the fix to permission().

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 1d3741c5d991686699f100b65b9956f7ee7ae0ae commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>VFS: Remove redundant open-coded mode bit check in prepare_binfmt().</title>
<updated>2006-08-24T19:55:06+00:00</updated>
<author>
<name>Trond Myklebust</name>
<email>Trond.Myklebust@netapp.com</email>
</author>
<published>2006-08-23T00:06:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=9167b0b9a0ab7907191523f5a0528e3b9c288e21'/>
<id>9167b0b9a0ab7907191523f5a0528e3b9c288e21</id>
<content type='text'>
The check in prepare_binfmt() for inode-&gt;i_mode &amp; 0111 is redundant,
since open_exec() will already have done that.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 822dec482ced07af32c378cd936d77345786572b commit)
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The check in prepare_binfmt() for inode-&gt;i_mode &amp; 0111 is redundant,
since open_exec() will already have done that.

Signed-off-by: Trond Myklebust &lt;Trond.Myklebust@netapp.com&gt;
(cherry picked from 822dec482ced07af32c378cd936d77345786572b commit)
</pre>
</div>
</content>
</entry>
<entry>
<title>Remove obsolete #include &lt;linux/config.h&gt;</title>
<updated>2006-06-30T17:25:36+00:00</updated>
<author>
<name>Jörn Engel</name>
<email>joern@wohnheim.fh-wedel.de</email>
</author>
<published>2006-06-30T17:25:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=6ab3d5624e172c553004ecc862bfeac16d9d68b7'/>
<id>6ab3d5624e172c553004ecc862bfeac16d9d68b7</id>
<content type='text'>
Signed-off-by: Jörn Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Signed-off-by: Jörn Engel &lt;joern@wohnheim.fh-wedel.de&gt;
Signed-off-by: Adrian Bunk &lt;bunk@stusta.de&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: shutdown current process first</title>
<updated>2006-06-26T16:58:27+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:09+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=5debfa6da5b06954bc79fe8deed0d1062c58dcec'/>
<id>5debfa6da5b06954bc79fe8deed0d1062c58dcec</id>
<content type='text'>
This patch optimizes zap_threads() for the case when there are no -&gt;mm
users except the current's thread group.  In that case we can avoid
'for_each_process()' loop.

It also adds a useful invariant: SIGNAL_GROUP_EXIT (if checked under
-&gt;siglock) always implies that all threads (except may be current) have
pending SIGKILL.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch optimizes zap_threads() for the case when there are no -&gt;mm
users except the current's thread group.  In that case we can avoid
'for_each_process()' loop.

It also adds a useful invariant: SIGNAL_GROUP_EXIT (if checked under
-&gt;siglock) always implies that all threads (except may be current) have
pending SIGKILL.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: some code relocations</title>
<updated>2006-06-26T16:58:27+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=dcf560c59330945a231d5e52f95dfedde4e32c9d'/>
<id>dcf560c59330945a231d5e52f95dfedde4e32c9d</id>
<content type='text'>
This is a preparation for the next patch.  No functional changes.
Basically, this patch moves '-&gt;flags &amp; SIGNAL_GROUP_EXIT' check into
zap_threads(), and 'complete(vfork_done)' into coredump_wait outside of
-&gt;mmap_sem protected area.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This is a preparation for the next patch.  No functional changes.
Basically, this patch moves '-&gt;flags &amp; SIGNAL_GROUP_EXIT' check into
zap_threads(), and 'complete(vfork_done)' into coredump_wait outside of
-&gt;mmap_sem protected area.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: don't take tasklist_lock</title>
<updated>2006-06-26T16:58:27+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:08+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=7b1c6154fa8bb937e0b1b4f2adbb315d70270f10'/>
<id>7b1c6154fa8bb937e0b1b4f2adbb315d70270f10</id>
<content type='text'>
This patch removes tasklist_lock from zap_threads().
This is safe wrt:

	do_exit:
		The caller holds mm-&gt;mmap_sem. This means that task which
		shares the same -&gt;mm can't pass exit_mm(), so it can't be
		unhashed from init_task.tasks or -&gt;thread_group lists.

	fork:
		None of sub-threads can fork after zap_process(leader). All
		processes which were created before this point should be
		visible to zap_threads() because copy_process() adds the new
		process to the tail of init_task.tasks list, and -&gt;siglock
		lock/unlock provides a memory barrier.

	de_thread:
		It does list_replace_rcu(&amp;leader-&gt;tasks, &amp;current-&gt;tasks).
		So zap_threads() will see either old or new leader, it does
		not matter. However, it can change p-&gt;sighand, so we should
		use lock_task_sighand() in zap_process().

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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This patch removes tasklist_lock from zap_threads().
This is safe wrt:

	do_exit:
		The caller holds mm-&gt;mmap_sem. This means that task which
		shares the same -&gt;mm can't pass exit_mm(), so it can't be
		unhashed from init_task.tasks or -&gt;thread_group lists.

	fork:
		None of sub-threads can fork after zap_process(leader). All
		processes which were created before this point should be
		visible to zap_threads() because copy_process() adds the new
		process to the tail of init_task.tasks list, and -&gt;siglock
		lock/unlock provides a memory barrier.

	de_thread:
		It does list_replace_rcu(&amp;leader-&gt;tasks, &amp;current-&gt;tasks).
		So zap_threads() will see either old or new leader, it does
		not matter. However, it can change p-&gt;sighand, so we should
		use lock_task_sighand() in zap_process().

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;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: kill ptrace related stuff</title>
<updated>2006-06-26T16:58:27+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:07+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=d5f70c00ad24cd1158d3678b44ff969b4c971d49'/>
<id>d5f70c00ad24cd1158d3678b44ff969b4c971d49</id>
<content type='text'>
With this patch zap_process() sets SIGNAL_GROUP_EXIT while sending SIGKILL to
the thread group.  This means that a TASK_TRACED task

	1. Will be awakened by signal_wake_up(1)

	2. Can't sleep again via ptrace_notify()

	3. Can't go to do_signal_stop() after return
	   from ptrace_stop() in get_signal_to_deliver()

So we can remove all ptrace related stuff from coredump path.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this patch zap_process() sets SIGNAL_GROUP_EXIT while sending SIGKILL to
the thread group.  This means that a TASK_TRACED task

	1. Will be awakened by signal_wake_up(1)

	2. Can't sleep again via ptrace_notify()

	3. Can't go to do_signal_stop() after return
	   from ptrace_stop() in get_signal_to_deliver()

So we can remove all ptrace related stuff from coredump path.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Cc: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: speedup SIGKILL sending</title>
<updated>2006-06-26T16:58:27+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:06+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=281de339ceb822ca6c04d4373ecb9a45c1890ce4'/>
<id>281de339ceb822ca6c04d4373ecb9a45c1890ce4</id>
<content type='text'>
With this patch a thread group is killed atomically under -&gt;siglock.  This is
faster because we can use sigaddset() instead of force_sig_info() and this is
used in further patches.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
With this patch a thread group is killed atomically under -&gt;siglock.  This is
faster because we can use sigaddset() instead of force_sig_info() and this is
used in further patches.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>[PATCH] coredump: optimize -&gt;mm users traversal</title>
<updated>2006-06-26T16:58:26+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2006-06-26T07:26:05+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=aceecc041217b35df753d1ed6e25bd17c0c558d8'/>
<id>aceecc041217b35df753d1ed6e25bd17c0c558d8</id>
<content type='text'>
zap_threads() iterates over all threads to find those ones which share
current-&gt;mm.  All threads in the thread group share the same -&gt;mm, so we can
skip entire thread group if it has another -&gt;mm.

This patch shifts the killing of thread group into the newly added
zap_process() function.  This looks as unnecessary complication, but it is
used in further patches.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: "Eric W. Biederman" &lt;ebiederm@xmission.com&gt;
Acked-by: Roland McGrath &lt;roland@redhat.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@osdl.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@osdl.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
zap_threads() iterates over all threads to find those ones which share
current-&gt;mm.  All threads in the thread group share the same -&gt;mm, so we can
skip entire thread group if it has another -&gt;mm.

This patch shifts the killing of thread group into the newly added
zap_process() function.  This looks as unnecessary complication, but it is
used in further patches.

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