[PATCH] test6-pre kmod accounting bug

From: Mikael Pettersson (mikpe@csd.uu.se)
Date: Fri Aug 04 2000 - 11:06:56 EST


Linus,

2.4.0-test6-pre reintroduced an old process accounting bug in kmod.
The problem is that free_uid() now just drops the reference without
decrementing the #processes counter. This causes the user to be
debited for a process it didn't fork() itself.

The fix is to atomic_dec(&user->processes) before free_uid(user),
just like fork() does if it fails. Please apply the patch below.

/Mikael

--- linux-2.4.0-test6-pre2/kernel/kmod.c.~1~ Fri Aug 4 12:24:18 2000
+++ linux-2.4.0-test6-pre2/kernel/kmod.c Fri Aug 4 14:20:49 2000
@@ -112,6 +112,7 @@
                 struct user_struct *user = current->user;
                 current->user = INIT_USER;
                 atomic_inc(&current->user->__count);
+ atomic_dec(&user->processes);
                 free_uid(user);
         }
 

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.tux.org/lkml/



This archive was generated by hypermail 2b29 : Mon Aug 07 2000 - 21:00:13 EST