Re: [PATCH] acquire mmap semaphore in pagemap_read.

From: Alexey Dobriyan
Date: Thu Mar 12 2009 - 07:38:43 EST


On Thu, Mar 12, 2009 at 11:33:08AM +0100, Martin Schwidefsky wrote:
> --- linux-2.6/fs/proc/task_mmu.c
> +++ linux-2.6-patched/fs/proc/task_mmu.c
> @@ -716,7 +716,9 @@ static ssize_t pagemap_read(struct file
> * user buffer is tracked in "pm", and the walk
> * will stop when we hit the end of the buffer.
> */
> + down_read(&mm->mmap_sem);
> ret = walk_page_range(start_vaddr, end_vaddr, &pagemap_walk);
> + up_read(&mm->mmap_sem);

This will introduce "put_user under mmap_sem" which is deadlockable.
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/