diff options
| author | Andrew Morton <akpm@digeo.com> | 2003-02-10 07:37:12 -0800 |
|---|---|---|
| committer | Linus Torvalds <torvalds@home.transmeta.com> | 2003-02-10 07:37:12 -0800 |
| commit | b789ebfca657a1fc77f6bd4dd648c0d5e96057c8 (patch) | |
| tree | 96074583f732c733a6a62eabe48ca7f35203be98 /include/linux/sched.h | |
| parent | 3322be329b2b75c784e0614aee71adc0dff2afdc (diff) | |
[PATCH] fix current->user->processes leak
Patch from: Eric Lammerts <eric@lammerts.org>
Every time you do a loop mount, a kernel thread is started (those
processes are called "loop0", "loop1", etc.). The problem is that when
it starts, it's counted as one of your processes. Then, it's
changed to be a root-owned process without correcting that count.
Patch below fixes the problem. It moves the bookkeeping of changing
current->user to a new function switch_uid() (which is now also used
by exec_usermodehelper() in kmod.c). The patch is tested.
Diffstat (limited to 'include/linux/sched.h')
| -rw-r--r-- | include/linux/sched.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/sched.h b/include/linux/sched.h index 16864532fcd9..b99d2eb57a82 100644 --- a/include/linux/sched.h +++ b/include/linux/sched.h @@ -509,6 +509,7 @@ extern void __set_special_pids(pid_t session, pid_t pgrp); /* per-UID process charging. */ extern struct user_struct * alloc_uid(uid_t); extern void free_uid(struct user_struct *); +extern void switch_uid(struct user_struct *); #include <asm/current.h> |
