<feed xmlns='http://www.w3.org/2005/Atom'>
<title>linux-toradex.git/kernel/kmod.c, branch v2.6.25-rc2</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>Dont touch fs_struct in usermodehelper</title>
<updated>2008-02-15T05:13:32+00:00</updated>
<author>
<name>Jan Blunck</name>
<email>jblunck@suse.de</email>
</author>
<published>2008-02-15T03:34:29+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=db74ece990ea59a9ec9f00f8881026059ef5caf5'/>
<id>db74ece990ea59a9ec9f00f8881026059ef5caf5</id>
<content type='text'>
This test seems to be unnecessary since we always have rootfs mounted before
calling a usermodehelper.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Greg KH &lt;greg@kroah.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
This test seems to be unnecessary since we always have rootfs mounted before
calling a usermodehelper.

Signed-off-by: Andreas Gruenbacher &lt;agruen@suse.de&gt;
Signed-off-by: Jan Blunck &lt;jblunck@suse.de&gt;
Acked-by: Christoph Hellwig &lt;hch@lst.de&gt;
Acked-by: Greg KH &lt;greg@kroah.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Fix unbalanced helper_lock in kernel/kmod.c</title>
<updated>2008-01-17T23:38:59+00:00</updated>
<author>
<name>Nigel Cunningham</name>
<email>nigel@nigel.suspend2.net</email>
</author>
<published>2008-01-17T23:21:21+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=784680336b616dcc4c17cbd25add3b49c555cdeb'/>
<id>784680336b616dcc4c17cbd25add3b49c555cdeb</id>
<content type='text'>
call_usermodehelper_exec() has an exit path that can leave the
helper_lock() call at the top of the routine unbalanced.  The attached
patch fixes this issue.

Signed-off-by: Nigel Cunningham &lt;nigel@tuxonice.net&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
call_usermodehelper_exec() has an exit path that can leave the
helper_lock() call at the top of the routine unbalanced.  The attached
patch fixes this issue.

Signed-off-by: Nigel Cunningham &lt;nigel@tuxonice.net&gt;
Cc: &lt;stable@kernel.org&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>Restore call_usermodehelper_pipe() behaviour</title>
<updated>2007-09-12T00:21:20+00:00</updated>
<author>
<name>Michael Ellerman</name>
<email>michael@ellerman.id.au</email>
</author>
<published>2007-09-11T22:23:51+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=3210f0ecdba6a81c3f8efe6f442d2e1f57db98f9'/>
<id>3210f0ecdba6a81c3f8efe6f442d2e1f57db98f9</id>
<content type='text'>
The semantics of call_usermodehelper_pipe() used to be that it would fork
the helper, and wait for the kernel thread to be started.  This was
implemented by setting sub_info.wait to 0 (implicitly), and doing a
wait_for_completion().

As part of the cleanup done in 0ab4dc92278a0f3816e486d6350c6652a72e06c8,
call_usermodehelper_pipe() was changed to pass 1 as the value for wait to
call_usermodehelper_exec().

This is equivalent to setting sub_info.wait to 1, which is a change from
the previous behaviour.  Using 1 instead of 0 causes
__call_usermodehelper() to start the kernel thread running
wait_for_helper(), rather than directly calling ____call_usermodehelper().

The end result is that the calling kernel code blocks until the user mode
helper finishes.  As the helper is expecting input on stdin, and now no one
is writing anything, everything locks up (observed in do_coredump).

The fix is to change the 1 to UMH_WAIT_EXEC (aka 0), indicating that we
want to wait for the kernel thread to be started, but not for the helper to
finish.

Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Acked-by: Andi Kleen &lt;ak@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
The semantics of call_usermodehelper_pipe() used to be that it would fork
the helper, and wait for the kernel thread to be started.  This was
implemented by setting sub_info.wait to 0 (implicitly), and doing a
wait_for_completion().

As part of the cleanup done in 0ab4dc92278a0f3816e486d6350c6652a72e06c8,
call_usermodehelper_pipe() was changed to pass 1 as the value for wait to
call_usermodehelper_exec().

This is equivalent to setting sub_info.wait to 1, which is a change from
the previous behaviour.  Using 1 instead of 0 causes
__call_usermodehelper() to start the kernel thread running
wait_for_helper(), rather than directly calling ____call_usermodehelper().

The end result is that the calling kernel code blocks until the user mode
helper finishes.  As the helper is expecting input on stdin, and now no one
is writing anything, everything locks up (observed in do_coredump).

The fix is to change the 1 to UMH_WAIT_EXEC (aka 0), indicating that we
want to wait for the kernel thread to be started, but not for the helper to
finish.

Signed-off-by: Michael Ellerman &lt;michael@ellerman.id.au&gt;
Acked-by: Andi Kleen &lt;ak@suse.de&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>kernel-doc fix for kmod.c</title>
<updated>2007-07-26T18:33:06+00:00</updated>
<author>
<name>Randy Dunlap</name>
<email>randy.dunlap@oracle.com</email>
</author>
<published>2007-07-26T17:40:56+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=61df47c8da1b4ba0f243975f11efc8956de0cba6'/>
<id>61df47c8da1b4ba0f243975f11efc8956de0cba6</id>
<content type='text'>
Fix kmod.c:
Warning(linux-2.6.23-rc1//kernel/kmod.c:364): No description found for parameter 'envp'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Fix kmod.c:
Warning(linux-2.6.23-rc1//kernel/kmod.c:364): No description found for parameter 'envp'

Signed-off-by: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM: prevent frozen user mode helpers from failing the freezing of tasks</title>
<updated>2007-07-19T17:04:42+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-19T08:47:37+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=ccd4b65aef4be2278543fde5b999e55a4d694fd8'/>
<id>ccd4b65aef4be2278543fde5b999e55a4d694fd8</id>
<content type='text'>
At present, if a user mode helper is running while
usermodehelper_pm_callback() is executed, the helper may be frozen and the
completion in call_usermodehelper_exec() won't be completed until user
space processes are thawed.  As a result, the freezing of kernel threads
may fail, which is not desirable.

Prevent this from happening by introducing a counter of running user mode
helpers and allowing usermodehelper_pm_callback() to succeed for action =
PM_HIBERNATION_PREPARE or action = PM_SUSPEND_PREPARE only if there are no
helpers running.  [Namely, usermodehelper_pm_callback() waits for at most
RUNNING_HELPERS_TIMEOUT for the number of running helpers to become zero
and fails if that doesn't happen.]

Special thanks to Uli Luckas &lt;u.luckas@road.de&gt;, Pavel Machek
&lt;pavel@ucw.cz&gt; and Oleg Nesterov &lt;oleg@tv-sign.ru&gt; for reviewing the
previous versions of this patch and for very useful comments.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Uli Luckas &lt;u.luckas@road.de&gt;
Acked-by: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
At present, if a user mode helper is running while
usermodehelper_pm_callback() is executed, the helper may be frozen and the
completion in call_usermodehelper_exec() won't be completed until user
space processes are thawed.  As a result, the freezing of kernel threads
may fail, which is not desirable.

Prevent this from happening by introducing a counter of running user mode
helpers and allowing usermodehelper_pm_callback() to succeed for action =
PM_HIBERNATION_PREPARE or action = PM_SUSPEND_PREPARE only if there are no
helpers running.  [Namely, usermodehelper_pm_callback() waits for at most
RUNNING_HELPERS_TIMEOUT for the number of running helpers to become zero
and fails if that doesn't happen.]

Special thanks to Uli Luckas &lt;u.luckas@road.de&gt;, Pavel Machek
&lt;pavel@ucw.cz&gt; and Oleg Nesterov &lt;oleg@tv-sign.ru&gt; for reviewing the
previous versions of this patch and for very useful comments.

Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Uli Luckas &lt;u.luckas@road.de&gt;
Acked-by: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>PM: disable usermode helper before hibernation and suspend</title>
<updated>2007-07-19T17:04:42+00:00</updated>
<author>
<name>Rafael J. Wysocki</name>
<email>rjw@sisk.pl</email>
</author>
<published>2007-07-19T08:47:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=8cdd4936c17bd8085cb0dfacc4a37ccf8d0ada7b'/>
<id>8cdd4936c17bd8085cb0dfacc4a37ccf8d0ada7b</id>
<content type='text'>
Use a hibernation and suspend notifier to disable the user mode helper before
a hibernation/suspend and enable it after the operation.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Use a hibernation and suspend notifier to disable the user mode helper before
a hibernation/suspend and enable it after the operation.

[akpm@linux-foundation.org: build fix]
Signed-off-by: Rafael J. Wysocki &lt;rjw@sisk.pl&gt;
Acked-by: Pavel Machek &lt;pavel@ucw.cz&gt;
Acked-by: Nigel Cunningham &lt;nigel@nigel.suspend2.net&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usermodehelper: Tidy up waiting</title>
<updated>2007-07-18T15:47:40+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@xensource.com</email>
</author>
<published>2007-07-18T01:37:03+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=86313c488a6848b7ec2ba04e74f25f79dd32a0b7'/>
<id>86313c488a6848b7ec2ba04e74f25f79dd32a0b7</id>
<content type='text'>
Rather than using a tri-state integer for the wait flag in
call_usermodehelper_exec, define a proper enum, and use that.  I've
preserved the integer values so that any callers I've missed should
still work OK.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Bjorn Helgaas &lt;bjorn.helgaas@hp.com&gt;
Cc: Joel Becker &lt;joel.becker@oracle.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Srivatsa Vaddagiri &lt;vatsa@in.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than using a tri-state integer for the wait flag in
call_usermodehelper_exec, define a proper enum, and use that.  I've
preserved the integer values so that any callers I've missed should
still work OK.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: James Bottomley &lt;James.Bottomley@HansenPartnership.com&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
Cc: Christoph Hellwig &lt;hch@infradead.org&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Paul Mackerras &lt;paulus@samba.org&gt;
Cc: Johannes Berg &lt;johannes@sipsolutions.net&gt;
Cc: Ralf Baechle &lt;ralf@linux-mips.org&gt;
Cc: Bjorn Helgaas &lt;bjorn.helgaas@hp.com&gt;
Cc: Joel Becker &lt;joel.becker@oracle.com&gt;
Cc: Tony Luck &lt;tony.luck@intel.com&gt;
Cc: Kay Sievers &lt;kay.sievers@vrfy.org&gt;
Cc: Srivatsa Vaddagiri &lt;vatsa@in.ibm.com&gt;
Cc: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>usermodehelper: split setup from execution</title>
<updated>2007-07-18T15:47:40+00:00</updated>
<author>
<name>Jeremy Fitzhardinge</name>
<email>jeremy@xensource.com</email>
</author>
<published>2007-07-18T01:37:02+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=0ab4dc92278a0f3816e486d6350c6652a72e06c8'/>
<id>0ab4dc92278a0f3816e486d6350c6652a72e06c8</id>
<content type='text'>
Rather than having hundreds of variations of call_usermodehelper for
various pieces of usermode state which could be set up, split the
info allocation and initialization from the actual process execution.

This means the general pattern becomes:
 info = call_usermodehelper_setup(path, argv, envp); /* basic state */
 call_usermodehelper_&lt;SET EXTRA STATE&gt;(info, stuff...);	/* extra state */
 call_usermodehelper_exec(info, wait);	/* run process and free info */

This patch introduces wrappers for all the existing calling styles for
call_usermodehelper_*, but folds their implementations into one.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Bj?rn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
Rather than having hundreds of variations of call_usermodehelper for
various pieces of usermode state which could be set up, split the
info allocation and initialization from the actual process execution.

This means the general pattern becomes:
 info = call_usermodehelper_setup(path, argv, envp); /* basic state */
 call_usermodehelper_&lt;SET EXTRA STATE&gt;(info, stuff...);	/* extra state */
 call_usermodehelper_exec(info, wait);	/* run process and free info */

This patch introduces wrappers for all the existing calling styles for
call_usermodehelper_*, but folds their implementations into one.

Signed-off-by: Jeremy Fitzhardinge &lt;jeremy@xensource.com&gt;
Cc: Andi Kleen &lt;ak@suse.de&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Cc: David Howells &lt;dhowells@redhat.com&gt;
Cc: Bj?rn Steinbrink &lt;B.Steinbrink@gmx.de&gt;
Cc: Randy Dunlap &lt;randy.dunlap@oracle.com&gt;
</pre>
</div>
</content>
</entry>
<entry>
<title>wait_for_helper: remove unneeded do_sigaction()</title>
<updated>2007-05-09T19:30:53+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2007-05-09T09:34:36+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=90cce03d9bfcb28600a56efef6b0a5a4fbf6c2b1'/>
<id>90cce03d9bfcb28600a56efef6b0a5a4fbf6c2b1</id>
<content type='text'>
allow_signal(SIGCHLD) does all necessary job, no need to call do_sigaction()
prior to.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&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>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
allow_signal(SIGCHLD) does all necessary job, no need to call do_sigaction()
prior to.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&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;
</pre>
</div>
</content>
</entry>
<entry>
<title>____call_usermodehelper: don't flush_signals()</title>
<updated>2007-05-09T19:30:53+00:00</updated>
<author>
<name>Oleg Nesterov</name>
<email>oleg@tv-sign.ru</email>
</author>
<published>2007-05-09T09:34:23+00:00</published>
<link rel='alternate' type='text/html' href='https://git.toradex.cn/cgit/linux-toradex.git/commit/?id=c93465181fed0f8f5942a41108943dadea0aa345'/>
<id>c93465181fed0f8f5942a41108943dadea0aa345</id>
<content type='text'>
____call_usermodehelper() has no reason for flush_signals().  It is a fresh
forked process which is going to exec a user-space application or exit on
failure.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</content>
<content type='xhtml'>
<div xmlns='http://www.w3.org/1999/xhtml'>
<pre>
____call_usermodehelper() has no reason for flush_signals().  It is a fresh
forked process which is going to exec a user-space application or exit on
failure.

Signed-off-by: Oleg Nesterov &lt;oleg@tv-sign.ru&gt;
Cc: Rusty Russell &lt;rusty@rustcorp.com.au&gt;
Signed-off-by: Andrew Morton &lt;akpm@linux-foundation.org&gt;
Signed-off-by: Linus Torvalds &lt;torvalds@linux-foundation.org&gt;
</pre>
</div>
</content>
</entry>
</feed>
