lkml.org 
[lkml]   [2005]   [Jan]   [13]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] do_brk() needs mmap_sem write-locked
From
Date
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/

\
 
 \ /
  Last update: 2005-03-22 14:09    [W:0.268 / U:0.100 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site