lkml.org 
[lkml]   [1998]   [Aug]   [17]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[patch] multithread execve bug
I think to have discovered and fixed a bug in the execve syscall. In
exec_mmap() if current->mm->count is > 1, linux alloc another mm struct,
but the new mm->segments pointer still point to the old process segments
area so if the new executed process will exit, it will release the
mm->segments that is shared also by the parent process. This segment
sharing could cause also other problems I think.

It cure the wine/kmod/vfree segfault that was on my TODO list from some
weeks. Patch against 115.

Andrea[s] Arcangeli

diff -urN /home/andrea/devel/kernel-tree/linux-2.1.115/fs/exec.c linux/fs/exec.c
--- /home/andrea/devel/kernel-tree/linux-2.1.115/fs/exec.c Sun Jun 14 02:35:42 1998
+++ linux/fs/exec.c Mon Aug 17 20:30:08 1998
@@ -414,6 +414,7 @@
mm->cpu_vm_mask = (1UL << smp_processor_id());
mm->total_vm = 0;
mm->rss = 0;
+ copy_segments(current->pid, current, mm);
old_mm = current->mm;
current->mm = mm;
retval = new_page_tables(current);

-
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@vger.rutgers.edu
Please read the FAQ at http://www.altern.org/andrebalsa/doc/lkml-faq.html

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