patch-2.1.105 linux/kernel/kmod.c

Next file: linux/kernel/module.c
Previous file: linux/init/main.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.104/linux/kernel/kmod.c linux/kernel/kmod.c
@@ -66,8 +66,15 @@
 	    if (current->files->fd[i]) close(i);
 	}
 
-	set_fs(KERNEL_DS);	/* Allow execve args to be in kernel space. */
+	/* Give kmod all privileges.. */
 	current->uid = current->euid = current->fsuid = 0;
+	cap_set_full(current->cap_inheritable);
+	cap_set_full(current->cap_effective);
+
+	/* Allow execve args to be in kernel space. */
+	set_fs(KERNEL_DS);
+
+	/* Go, go, go... */
 	if (execve(modprobe_path, argv, envp) < 0) {
 		printk(KERN_ERR
 		       "kmod: failed to exec %s -s -k %s, errno = %d\n",

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov