patch-2.4.0-test6 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

diff -u --recursive --new-file v2.4.0-test5/linux/kernel/kmod.c linux/kernel/kmod.c
@@ -108,7 +108,14 @@
 	}
 
 	/* Drop the "current user" thing */
-	free_uid(current);
+	{
+		struct user_struct *user = current->user;
+		current->user = INIT_USER;
+		atomic_inc(&INIT_USER->__count);
+		atomic_inc(&INIT_USER->processes);
+		atomic_dec(&user->processes);
+		free_uid(user);
+	}
 
 	/* Give kmod all effective privileges.. */
 	current->uid = current->euid = current->fsuid = 0;

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)