Re: proc race (was: Re: HIGH MEMORY access)

From: Manfred Spraul (manfreds@colorfullife.com)
Date: Thu Apr 13 2000 - 16:46:49 EST


Alan Cox wrote:
>
> I think _exit_mm() needs to swap the mm a pointer to the task 0 mm, instead
> of NULL. Then all the weird cases go away

down(&tsk->mm);
        // tsk->mm is current->mm
up(&tsk->mm)
        // tsk->mm is &init_mm

That doesn't help :-(

But all caller of mmput() called lock_kernel(): perhaps
access_process_mm() should add an additional reference to the mm?

access_process_mm()
{
        lock_kernel(); [done by caller]
        mm=tsk->mm;
        if(!mm)
                goto out;
        /* This assumes that all caller of mmput() own the big kernel lock
         */
        atomic_inc(&mm->mm_users);
        do_something__could_sleep(mm);
        mmput();
        unlock_kernel();
}

I'll write a patch,

        Manfred

-
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 : Sat Apr 15 2000 - 21:00:22 EST