Skip to content

Commit

Permalink
Boot up with usermodehelper disabled
Browse files Browse the repository at this point in the history
The core device layer sends tons of uevent notifications for each device
it finds, and if the kernel has been built with a non-empty
CONFIG_UEVENT_HELPER_PATH that will make us try to execute the usermode
helper binary for all these events very early in the boot.

Not only won't the root filesystem even be mounted at that point, we
literally won't have necessarily even initialized all the process
handling data structures at that point, which causes no end of silly
problems even when the usermode helper doesn't actually succeed in
executing.

So just use our existing infrastructure to disable the usermodehelpers
to make the kernel start out with them disabled.  We enable them when
we've at least initialized stuff a bit.

Problems related to an uninitialized

	init_ipc_ns.ids[IPC_SHM_IDS].rw_mutex

reported by various people.

Reported-by: Manuel Lauss <[email protected]>
Reported-by: Richard Weinberger <[email protected]>
Reported-by: Marc Zyngier <[email protected]>
Acked-by: Kay Sievers <[email protected]>
Cc: Andrew Morton <[email protected]>
Cc: Vasiliy Kulikov <[email protected]>
Cc: Greg KH <[email protected]>
Signed-off-by: Linus Torvalds <[email protected]>
  • Loading branch information
torvalds committed Aug 4, 2011
1 parent 33f35f2 commit 288d5ab
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
5 changes: 4 additions & 1 deletion init/main.c
Original file line number Diff line number Diff line change
Expand Up @@ -369,9 +369,12 @@ static noinline void __init_refok rest_init(void)
init_idle_bootup_task(current);
preempt_enable_no_resched();
schedule();
preempt_disable();

/* At this point, we can enable user mode helper functionality */
usermodehelper_enable();

/* Call into cpu_idle with preempt disabled */
preempt_disable();
cpu_idle();
}

Expand Down
2 changes: 1 addition & 1 deletion kernel/kmod.c
Original file line number Diff line number Diff line change
Expand Up @@ -274,7 +274,7 @@ static void __call_usermodehelper(struct work_struct *work)
* (used for preventing user land processes from being created after the user
* land has been frozen during a system-wide hibernation or suspend operation).
*/
static int usermodehelper_disabled;
static int usermodehelper_disabled = 1;

/* Number of helpers running */
static atomic_t running_helpers = ATOMIC_INIT(0);
Expand Down

0 comments on commit 288d5ab

Please sign in to comment.