lkml.org 
[lkml]   [2002]   [May]   [16]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: PATCH Multithreaded core dump support for the 2.5.14 (and 15) kernel.
On Thu, May 16, 2002 at 10:13:40AM -0400, Mark Gross wrote:
> Also, does anyone know WHY the mmap_sem is needed in the elf_core_dump code,
> and is this need still valid if I've suspended all the other processes that
> could even touch that mm? I.e. can I fix this by removing the down_write /
> up_write in elf_core_dump?

The mmap_sem is needed to access current->mm (especially the vma list)
safely. Otherwise someone else sharing the mm_struct could modify it.
If you make sure all others sharing the mm_struct are killed first
(including now way for them to start new clones inbetween) then
the only loophole left would be remote access using /proc/pid/mem or ptrace.
If you handle that too then it is probably safe to drop it. Unfortunately
I don't see a way to handle these remote users without at least
taking it temporarily.

Of course there are other semaphores in involved in dumping too (e.g. the
VFS ->write code may take the i_sem or other private ones). I guess they
won't be a big problem if you first kill and then dump later.

-Andi

-
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 13:26    [W:0.079 / U:0.068 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site