• Andrew Morton's avatar
    [PATCH] fix current->user->processes leak · b789ebfc
    Andrew Morton authored
    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.
    b789ebfc
user.c 3.53 KB