[lkml]   [2001]   [Sep]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
Messages in this thread
    SubjectRe: Deadlock on the mm->mmap_sem
    > What happens is that proc_pid_read_maps grabs the mmap_sem as a
    > reader, and *while it holds the lock*, does a copy_to_user. This can
    > of course page-fault, and the handler will also grab the mmap_sem
    > (if it is the same task).

    Ok, that's a bug.
    You must not call copy_to_user with the mmap semaphore acquired - linux
    semaphores are not recursive.

    > Any ideas how to fix this? Should proc_pid_read_maps just drop the
    > lock before copy_to_user?

    Yes, and preferable switch to multiline copies - a full page temporary
    buffer is allocated, transfering data on a line-by-line base is way too
    much overhead (and the current volatile_task is an ugly hack).


    To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
    the body of a message to
    More majordomo info at
    Please read the FAQ at

     \ /
      Last update: 2005-03-22 13:03    [W:0.023 / U:4.724 seconds]
    ©2003-2017 Jasper Spaans. hosted at Digital OceanAdvertise on this site