patch-2.1.106 linux/kernel/kmod.c
Next file: linux/kernel/ksyms.c
Previous file: linux/kernel/fork.c
Back to the patch index
Back to the overall index
- Lines: 14
- Date:
Sat Jun 13 10:23:41 1998
- Orig file:
v2.1.105/linux/kernel/kmod.c
- Orig date:
Tue Jun 9 11:57:31 1998
diff -u --recursive --new-file v2.1.105/linux/kernel/kmod.c linux/kernel/kmod.c
@@ -93,6 +93,13 @@
int pid;
int waitpid_result;
+ /* Don't allow request_module() before the root fs is mounted! */
+ if ( ! current->fs->root ) {
+ printk(KERN_ERR "request_module[%s]: Root fs not mounted\n",
+ module_name);
+ return -EPERM;
+ }
+
pid = kernel_thread(exec_modprobe, (void*) module_name, CLONE_FS);
if (pid < 0) {
printk(KERN_ERR "kmod: fork failed, errno %d\n", -pid);
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov