Messages in this thread | | | Subject | Re: [PATCH] do_brk() needs mmap_sem write-locked | From | Alan Cox <> | Date | Thu, 13 Jan 2005 15:36:21 +0000 |
| |
On Mer, 2005-01-12 at 16:03, Linus Torvalds wrote: > if that warning ever triggers, mmap_sem will now be locked, and that will > cause problems. So I suspect it's better to do > > if (down_read_trylock(&mm->mmap_sem)) { > WARN_ON(1); > up_read(&mm->mmap_sem);
Better to leave the lock held and remember the error then drop it at the end - anything else means the WARN_ON case is a security hole.
- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |