kmod.c 17 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669
  1. /*
  2. kmod, the new module loader (replaces kerneld)
  3. Kirk Petersen
  4. Reorganized not to be a daemon by Adam Richter, with guidance
  5. from Greg Zornetzer.
  6. Modified to avoid chroot and file sharing problems.
  7. Mikael Pettersson
  8. Limit the concurrent number of kmod modprobes to catch loops from
  9. "modprobe needs a service that is in a module".
  10. Keith Owens <kaos@ocs.com.au> December 1999
  11. Unblock all signals when we exec a usermode process.
  12. Shuu Yamaguchi <shuu@wondernetworkresources.com> December 2000
  13. call_usermodehelper wait flag, and remove exec_usermodehelper.
  14. Rusty Russell <rusty@rustcorp.com.au> Jan 2003
  15. */
  16. #include <linux/module.h>
  17. #include <linux/sched.h>
  18. #include <linux/syscalls.h>
  19. #include <linux/unistd.h>
  20. #include <linux/kmod.h>
  21. #include <linux/slab.h>
  22. #include <linux/completion.h>
  23. #include <linux/cred.h>
  24. #include <linux/file.h>
  25. #include <linux/fdtable.h>
  26. #include <linux/workqueue.h>
  27. #include <linux/security.h>
  28. #include <linux/mount.h>
  29. #include <linux/kernel.h>
  30. #include <linux/init.h>
  31. #include <linux/resource.h>
  32. #include <linux/notifier.h>
  33. #include <linux/suspend.h>
  34. #include <linux/rwsem.h>
  35. #include <asm/uaccess.h>
  36. #include <trace/events/module.h>
  37. extern int max_threads;
  38. static struct workqueue_struct *khelper_wq;
  39. #define CAP_BSET (void *)1
  40. #define CAP_PI (void *)2
  41. static kernel_cap_t usermodehelper_bset = CAP_FULL_SET;
  42. static kernel_cap_t usermodehelper_inheritable = CAP_FULL_SET;
  43. static DEFINE_SPINLOCK(umh_sysctl_lock);
  44. static DECLARE_RWSEM(umhelper_sem);
  45. #ifdef CONFIG_MODULES
  46. /*
  47. modprobe_path is set via /proc/sys.
  48. */
  49. char modprobe_path[KMOD_PATH_LEN] = "/sbin/modprobe";
  50. static void free_modprobe_argv(struct subprocess_info *info)
  51. {
  52. kfree(info->argv[3]); /* check call_modprobe() */
  53. kfree(info->argv);
  54. }
  55. static int call_modprobe(char *module_name, int wait)
  56. {
  57. static char *envp[] = {
  58. "HOME=/",
  59. "TERM=linux",
  60. "PATH=/sbin:/usr/sbin:/bin:/usr/bin",
  61. NULL
  62. };
  63. char **argv = kmalloc(sizeof(char *[5]), GFP_KERNEL);
  64. if (!argv)
  65. goto out;
  66. module_name = kstrdup(module_name, GFP_KERNEL);
  67. if (!module_name)
  68. goto free_argv;
  69. argv[0] = modprobe_path;
  70. argv[1] = "-q";
  71. argv[2] = "--";
  72. argv[3] = module_name; /* check free_modprobe_argv() */
  73. argv[4] = NULL;
  74. return call_usermodehelper_fns(modprobe_path, argv, envp,
  75. wait | UMH_KILLABLE, NULL, free_modprobe_argv, NULL);
  76. free_argv:
  77. kfree(argv);
  78. out:
  79. return -ENOMEM;
  80. }
  81. /**
  82. * __request_module - try to load a kernel module
  83. * @wait: wait (or not) for the operation to complete
  84. * @fmt: printf style format string for the name of the module
  85. * @...: arguments as specified in the format string
  86. *
  87. * Load a module using the user mode module loader. The function returns
  88. * zero on success or a negative errno code on failure. Note that a
  89. * successful module load does not mean the module did not then unload
  90. * and exit on an error of its own. Callers must check that the service
  91. * they requested is now available not blindly invoke it.
  92. *
  93. * If module auto-loading support is disabled then this function
  94. * becomes a no-operation.
  95. */
  96. int __request_module(bool wait, const char *fmt, ...)
  97. {
  98. va_list args;
  99. char module_name[MODULE_NAME_LEN];
  100. unsigned int max_modprobes;
  101. int ret;
  102. static atomic_t kmod_concurrent = ATOMIC_INIT(0);
  103. #define MAX_KMOD_CONCURRENT 50 /* Completely arbitrary value - KAO */
  104. static int kmod_loop_msg;
  105. va_start(args, fmt);
  106. ret = vsnprintf(module_name, MODULE_NAME_LEN, fmt, args);
  107. va_end(args);
  108. if (ret >= MODULE_NAME_LEN)
  109. return -ENAMETOOLONG;
  110. ret = security_kernel_module_request(module_name);
  111. if (ret)
  112. return ret;
  113. /* If modprobe needs a service that is in a module, we get a recursive
  114. * loop. Limit the number of running kmod threads to max_threads/2 or
  115. * MAX_KMOD_CONCURRENT, whichever is the smaller. A cleaner method
  116. * would be to run the parents of this process, counting how many times
  117. * kmod was invoked. That would mean accessing the internals of the
  118. * process tables to get the command line, proc_pid_cmdline is static
  119. * and it is not worth changing the proc code just to handle this case.
  120. * KAO.
  121. *
  122. * "trace the ppid" is simple, but will fail if someone's
  123. * parent exits. I think this is as good as it gets. --RR
  124. */
  125. max_modprobes = min(max_threads/2, MAX_KMOD_CONCURRENT);
  126. atomic_inc(&kmod_concurrent);
  127. if (atomic_read(&kmod_concurrent) > max_modprobes) {
  128. /* We may be blaming an innocent here, but unlikely */
  129. if (kmod_loop_msg < 5) {
  130. printk(KERN_ERR
  131. "request_module: runaway loop modprobe %s\n",
  132. module_name);
  133. kmod_loop_msg++;
  134. }
  135. atomic_dec(&kmod_concurrent);
  136. return -ENOMEM;
  137. }
  138. trace_module_request(module_name, wait, _RET_IP_);
  139. ret = call_modprobe(module_name, wait ? UMH_WAIT_PROC : UMH_WAIT_EXEC);
  140. atomic_dec(&kmod_concurrent);
  141. return ret;
  142. }
  143. EXPORT_SYMBOL(__request_module);
  144. #endif /* CONFIG_MODULES */
  145. /*
  146. * This is the task which runs the usermode application
  147. */
  148. static int ____call_usermodehelper(void *data)
  149. {
  150. struct subprocess_info *sub_info = data;
  151. struct cred *new;
  152. int retval;
  153. spin_lock_irq(&current->sighand->siglock);
  154. flush_signal_handlers(current, 1);
  155. spin_unlock_irq(&current->sighand->siglock);
  156. /* We can run anywhere, unlike our parent keventd(). */
  157. set_cpus_allowed_ptr(current, cpu_all_mask);
  158. /*
  159. * Our parent is keventd, which runs with elevated scheduling priority.
  160. * Avoid propagating that into the userspace child.
  161. */
  162. set_user_nice(current, 0);
  163. retval = -ENOMEM;
  164. new = prepare_kernel_cred(current);
  165. if (!new)
  166. goto fail;
  167. spin_lock(&umh_sysctl_lock);
  168. new->cap_bset = cap_intersect(usermodehelper_bset, new->cap_bset);
  169. new->cap_inheritable = cap_intersect(usermodehelper_inheritable,
  170. new->cap_inheritable);
  171. spin_unlock(&umh_sysctl_lock);
  172. if (sub_info->init) {
  173. retval = sub_info->init(sub_info, new);
  174. if (retval) {
  175. abort_creds(new);
  176. goto fail;
  177. }
  178. }
  179. commit_creds(new);
  180. retval = kernel_execve(sub_info->path,
  181. (const char *const *)sub_info->argv,
  182. (const char *const *)sub_info->envp);
  183. /* Exec failed? */
  184. fail:
  185. sub_info->retval = retval;
  186. return 0;
  187. }
  188. void call_usermodehelper_freeinfo(struct subprocess_info *info)
  189. {
  190. if (info->cleanup)
  191. (*info->cleanup)(info);
  192. kfree(info);
  193. }
  194. EXPORT_SYMBOL(call_usermodehelper_freeinfo);
  195. static void umh_complete(struct subprocess_info *sub_info)
  196. {
  197. struct completion *comp = xchg(&sub_info->complete, NULL);
  198. /*
  199. * See call_usermodehelper_exec(). If xchg() returns NULL
  200. * we own sub_info, the UMH_KILLABLE caller has gone away.
  201. */
  202. if (comp)
  203. complete(comp);
  204. else
  205. call_usermodehelper_freeinfo(sub_info);
  206. }
  207. /* Keventd can't block, but this (a child) can. */
  208. static int wait_for_helper(void *data)
  209. {
  210. struct subprocess_info *sub_info = data;
  211. pid_t pid;
  212. /* If SIGCLD is ignored sys_wait4 won't populate the status. */
  213. spin_lock_irq(&current->sighand->siglock);
  214. current->sighand->action[SIGCHLD-1].sa.sa_handler = SIG_DFL;
  215. spin_unlock_irq(&current->sighand->siglock);
  216. pid = kernel_thread(____call_usermodehelper, sub_info, SIGCHLD);
  217. if (pid < 0) {
  218. sub_info->retval = pid;
  219. } else {
  220. int ret = -ECHILD;
  221. /*
  222. * Normally it is bogus to call wait4() from in-kernel because
  223. * wait4() wants to write the exit code to a userspace address.
  224. * But wait_for_helper() always runs as keventd, and put_user()
  225. * to a kernel address works OK for kernel threads, due to their
  226. * having an mm_segment_t which spans the entire address space.
  227. *
  228. * Thus the __user pointer cast is valid here.
  229. */
  230. sys_wait4(pid, (int __user *)&ret, 0, NULL);
  231. /*
  232. * If ret is 0, either ____call_usermodehelper failed and the
  233. * real error code is already in sub_info->retval or
  234. * sub_info->retval is 0 anyway, so don't mess with it then.
  235. */
  236. if (ret)
  237. sub_info->retval = ret;
  238. }
  239. umh_complete(sub_info);
  240. return 0;
  241. }
  242. /* This is run by khelper thread */
  243. static void __call_usermodehelper(struct work_struct *work)
  244. {
  245. struct subprocess_info *sub_info =
  246. container_of(work, struct subprocess_info, work);
  247. int wait = sub_info->wait & ~UMH_KILLABLE;
  248. pid_t pid;
  249. /* CLONE_VFORK: wait until the usermode helper has execve'd
  250. * successfully We need the data structures to stay around
  251. * until that is done. */
  252. if (wait == UMH_WAIT_PROC)
  253. pid = kernel_thread(wait_for_helper, sub_info,
  254. CLONE_FS | CLONE_FILES | SIGCHLD);
  255. else
  256. pid = kernel_thread(____call_usermodehelper, sub_info,
  257. CLONE_VFORK | SIGCHLD);
  258. switch (wait) {
  259. case UMH_NO_WAIT:
  260. call_usermodehelper_freeinfo(sub_info);
  261. break;
  262. case UMH_WAIT_PROC:
  263. if (pid > 0)
  264. break;
  265. /* FALLTHROUGH */
  266. case UMH_WAIT_EXEC:
  267. if (pid < 0)
  268. sub_info->retval = pid;
  269. umh_complete(sub_info);
  270. }
  271. }
  272. /*
  273. * If set, call_usermodehelper_exec() will exit immediately returning -EBUSY
  274. * (used for preventing user land processes from being created after the user
  275. * land has been frozen during a system-wide hibernation or suspend operation).
  276. * Should always be manipulated under umhelper_sem acquired for write.
  277. */
  278. static enum umh_disable_depth usermodehelper_disabled = UMH_DISABLED;
  279. /* Number of helpers running */
  280. static atomic_t running_helpers = ATOMIC_INIT(0);
  281. /*
  282. * Wait queue head used by usermodehelper_disable() to wait for all running
  283. * helpers to finish.
  284. */
  285. static DECLARE_WAIT_QUEUE_HEAD(running_helpers_waitq);
  286. /*
  287. * Used by usermodehelper_read_lock_wait() to wait for usermodehelper_disabled
  288. * to become 'false'.
  289. */
  290. static DECLARE_WAIT_QUEUE_HEAD(usermodehelper_disabled_waitq);
  291. /*
  292. * Time to wait for running_helpers to become zero before the setting of
  293. * usermodehelper_disabled in usermodehelper_disable() fails
  294. */
  295. #define RUNNING_HELPERS_TIMEOUT (5 * HZ)
  296. int usermodehelper_read_trylock(void)
  297. {
  298. DEFINE_WAIT(wait);
  299. int ret = 0;
  300. down_read(&umhelper_sem);
  301. for (;;) {
  302. prepare_to_wait(&usermodehelper_disabled_waitq, &wait,
  303. TASK_INTERRUPTIBLE);
  304. if (!usermodehelper_disabled)
  305. break;
  306. if (usermodehelper_disabled == UMH_DISABLED)
  307. ret = -EAGAIN;
  308. up_read(&umhelper_sem);
  309. if (ret)
  310. break;
  311. schedule();
  312. try_to_freeze();
  313. down_read(&umhelper_sem);
  314. }
  315. finish_wait(&usermodehelper_disabled_waitq, &wait);
  316. return ret;
  317. }
  318. EXPORT_SYMBOL_GPL(usermodehelper_read_trylock);
  319. long usermodehelper_read_lock_wait(long timeout)
  320. {
  321. DEFINE_WAIT(wait);
  322. if (timeout < 0)
  323. return -EINVAL;
  324. down_read(&umhelper_sem);
  325. for (;;) {
  326. prepare_to_wait(&usermodehelper_disabled_waitq, &wait,
  327. TASK_UNINTERRUPTIBLE);
  328. if (!usermodehelper_disabled)
  329. break;
  330. up_read(&umhelper_sem);
  331. timeout = schedule_timeout(timeout);
  332. if (!timeout)
  333. break;
  334. down_read(&umhelper_sem);
  335. }
  336. finish_wait(&usermodehelper_disabled_waitq, &wait);
  337. return timeout;
  338. }
  339. EXPORT_SYMBOL_GPL(usermodehelper_read_lock_wait);
  340. void usermodehelper_read_unlock(void)
  341. {
  342. up_read(&umhelper_sem);
  343. }
  344. EXPORT_SYMBOL_GPL(usermodehelper_read_unlock);
  345. /**
  346. * __usermodehelper_set_disable_depth - Modify usermodehelper_disabled.
  347. * depth: New value to assign to usermodehelper_disabled.
  348. *
  349. * Change the value of usermodehelper_disabled (under umhelper_sem locked for
  350. * writing) and wakeup tasks waiting for it to change.
  351. */
  352. void __usermodehelper_set_disable_depth(enum umh_disable_depth depth)
  353. {
  354. down_write(&umhelper_sem);
  355. usermodehelper_disabled = depth;
  356. wake_up(&usermodehelper_disabled_waitq);
  357. up_write(&umhelper_sem);
  358. }
  359. /**
  360. * __usermodehelper_disable - Prevent new helpers from being started.
  361. * @depth: New value to assign to usermodehelper_disabled.
  362. *
  363. * Set usermodehelper_disabled to @depth and wait for running helpers to exit.
  364. */
  365. int __usermodehelper_disable(enum umh_disable_depth depth)
  366. {
  367. long retval;
  368. if (!depth)
  369. return -EINVAL;
  370. down_write(&umhelper_sem);
  371. usermodehelper_disabled = depth;
  372. up_write(&umhelper_sem);
  373. /*
  374. * From now on call_usermodehelper_exec() won't start any new
  375. * helpers, so it is sufficient if running_helpers turns out to
  376. * be zero at one point (it may be increased later, but that
  377. * doesn't matter).
  378. */
  379. retval = wait_event_timeout(running_helpers_waitq,
  380. atomic_read(&running_helpers) == 0,
  381. RUNNING_HELPERS_TIMEOUT);
  382. if (retval)
  383. return 0;
  384. __usermodehelper_set_disable_depth(UMH_ENABLED);
  385. return -EAGAIN;
  386. }
  387. static void helper_lock(void)
  388. {
  389. atomic_inc(&running_helpers);
  390. smp_mb__after_atomic_inc();
  391. }
  392. static void helper_unlock(void)
  393. {
  394. if (atomic_dec_and_test(&running_helpers))
  395. wake_up(&running_helpers_waitq);
  396. }
  397. /**
  398. * call_usermodehelper_setup - prepare to call a usermode helper
  399. * @path: path to usermode executable
  400. * @argv: arg vector for process
  401. * @envp: environment for process
  402. * @gfp_mask: gfp mask for memory allocation
  403. *
  404. * Returns either %NULL on allocation failure, or a subprocess_info
  405. * structure. This should be passed to call_usermodehelper_exec to
  406. * exec the process and free the structure.
  407. */
  408. struct subprocess_info *call_usermodehelper_setup(char *path, char **argv,
  409. char **envp, gfp_t gfp_mask)
  410. {
  411. struct subprocess_info *sub_info;
  412. sub_info = kzalloc(sizeof(struct subprocess_info), gfp_mask);
  413. if (!sub_info)
  414. goto out;
  415. INIT_WORK(&sub_info->work, __call_usermodehelper);
  416. sub_info->path = path;
  417. sub_info->argv = argv;
  418. sub_info->envp = envp;
  419. out:
  420. return sub_info;
  421. }
  422. EXPORT_SYMBOL(call_usermodehelper_setup);
  423. /**
  424. * call_usermodehelper_setfns - set a cleanup/init function
  425. * @info: a subprocess_info returned by call_usermodehelper_setup
  426. * @cleanup: a cleanup function
  427. * @init: an init function
  428. * @data: arbitrary context sensitive data
  429. *
  430. * The init function is used to customize the helper process prior to
  431. * exec. A non-zero return code causes the process to error out, exit,
  432. * and return the failure to the calling process
  433. *
  434. * The cleanup function is just before ethe subprocess_info is about to
  435. * be freed. This can be used for freeing the argv and envp. The
  436. * Function must be runnable in either a process context or the
  437. * context in which call_usermodehelper_exec is called.
  438. */
  439. void call_usermodehelper_setfns(struct subprocess_info *info,
  440. int (*init)(struct subprocess_info *info, struct cred *new),
  441. void (*cleanup)(struct subprocess_info *info),
  442. void *data)
  443. {
  444. info->cleanup = cleanup;
  445. info->init = init;
  446. info->data = data;
  447. }
  448. EXPORT_SYMBOL(call_usermodehelper_setfns);
  449. /**
  450. * call_usermodehelper_exec - start a usermode application
  451. * @sub_info: information about the subprocessa
  452. * @wait: wait for the application to finish and return status.
  453. * when -1 don't wait at all, but you get no useful error back when
  454. * the program couldn't be exec'ed. This makes it safe to call
  455. * from interrupt context.
  456. *
  457. * Runs a user-space application. The application is started
  458. * asynchronously if wait is not set, and runs as a child of keventd.
  459. * (ie. it runs with full root capabilities).
  460. */
  461. int call_usermodehelper_exec(struct subprocess_info *sub_info, int wait)
  462. {
  463. DECLARE_COMPLETION_ONSTACK(done);
  464. int retval = 0;
  465. helper_lock();
  466. if (!sub_info->path) {
  467. retval = -EINVAL;
  468. goto out;
  469. }
  470. if (sub_info->path[0] == '\0')
  471. goto out;
  472. if (!khelper_wq || usermodehelper_disabled) {
  473. retval = -EBUSY;
  474. goto out;
  475. }
  476. sub_info->complete = &done;
  477. sub_info->wait = wait;
  478. queue_work(khelper_wq, &sub_info->work);
  479. if (wait == UMH_NO_WAIT) /* task has freed sub_info */
  480. goto unlock;
  481. if (wait & UMH_KILLABLE) {
  482. retval = wait_for_completion_killable(&done);
  483. if (!retval)
  484. goto wait_done;
  485. /* umh_complete() will see NULL and free sub_info */
  486. if (xchg(&sub_info->complete, NULL))
  487. goto unlock;
  488. /* fallthrough, umh_complete() was already called */
  489. }
  490. wait_for_completion(&done);
  491. wait_done:
  492. retval = sub_info->retval;
  493. out:
  494. call_usermodehelper_freeinfo(sub_info);
  495. unlock:
  496. helper_unlock();
  497. return retval;
  498. }
  499. EXPORT_SYMBOL(call_usermodehelper_exec);
  500. static int proc_cap_handler(struct ctl_table *table, int write,
  501. void __user *buffer, size_t *lenp, loff_t *ppos)
  502. {
  503. struct ctl_table t;
  504. unsigned long cap_array[_KERNEL_CAPABILITY_U32S];
  505. kernel_cap_t new_cap;
  506. int err, i;
  507. if (write && (!capable(CAP_SETPCAP) ||
  508. !capable(CAP_SYS_MODULE)))
  509. return -EPERM;
  510. /*
  511. * convert from the global kernel_cap_t to the ulong array to print to
  512. * userspace if this is a read.
  513. */
  514. spin_lock(&umh_sysctl_lock);
  515. for (i = 0; i < _KERNEL_CAPABILITY_U32S; i++) {
  516. if (table->data == CAP_BSET)
  517. cap_array[i] = usermodehelper_bset.cap[i];
  518. else if (table->data == CAP_PI)
  519. cap_array[i] = usermodehelper_inheritable.cap[i];
  520. else
  521. BUG();
  522. }
  523. spin_unlock(&umh_sysctl_lock);
  524. t = *table;
  525. t.data = &cap_array;
  526. /*
  527. * actually read or write and array of ulongs from userspace. Remember
  528. * these are least significant 32 bits first
  529. */
  530. err = proc_doulongvec_minmax(&t, write, buffer, lenp, ppos);
  531. if (err < 0)
  532. return err;
  533. /*
  534. * convert from the sysctl array of ulongs to the kernel_cap_t
  535. * internal representation
  536. */
  537. for (i = 0; i < _KERNEL_CAPABILITY_U32S; i++)
  538. new_cap.cap[i] = cap_array[i];
  539. /*
  540. * Drop everything not in the new_cap (but don't add things)
  541. */
  542. spin_lock(&umh_sysctl_lock);
  543. if (write) {
  544. if (table->data == CAP_BSET)
  545. usermodehelper_bset = cap_intersect(usermodehelper_bset, new_cap);
  546. if (table->data == CAP_PI)
  547. usermodehelper_inheritable = cap_intersect(usermodehelper_inheritable, new_cap);
  548. }
  549. spin_unlock(&umh_sysctl_lock);
  550. return 0;
  551. }
  552. struct ctl_table usermodehelper_table[] = {
  553. {
  554. .procname = "bset",
  555. .data = CAP_BSET,
  556. .maxlen = _KERNEL_CAPABILITY_U32S * sizeof(unsigned long),
  557. .mode = 0600,
  558. .proc_handler = proc_cap_handler,
  559. },
  560. {
  561. .procname = "inheritable",
  562. .data = CAP_PI,
  563. .maxlen = _KERNEL_CAPABILITY_U32S * sizeof(unsigned long),
  564. .mode = 0600,
  565. .proc_handler = proc_cap_handler,
  566. },
  567. { }
  568. };
  569. void __init usermodehelper_init(void)
  570. {
  571. khelper_wq = create_singlethread_workqueue("khelper");
  572. BUG_ON(!khelper_wq);
  573. }