Skip to contentSkip to conversation

a fix for procfs-task-exe-symlink.patch

PATCH In review YAMAMOTO Takashi 2 participants 2 messages Mar 17, 2008

Subsystems (4)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 a fix for procfs-task-exe-symlink.patch

it seems that procfs-task-exe-symlink.patch broke the case of dup_mmap failure. ie. mm->exe_file is copied by memcpy from oldmm and then be fput'ed by mmput/set_mm_exe_file.

YAMAMOTO Takashi

---

kernel/fork.c renamed from kernel/fork.c.BACKUP +2 -1
@@ -523,11 +526,12 @@ static struct mm_struct *dup_mm(struct t
 	if (init_new_context(tsk, mm))
 		goto fail_nocontext;
 
+	dup_mm_exe_file(oldmm, mm);
+
 	err = dup_mmap(mm, oldmm);
 	if (err)
 		goto free_pt;
 
-	dup_mm_exe_file(oldmm, mm);
 	mm->hiwater_rss = get_mm_rss(mm);
 	mm->hiwater_vm = mm->total_vm;
 

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>

Acked-by on v1 1/1
#1 lore raw
Quoted 16 lines · YAMAMOTO Takashi

it seems that procfs-task-exe-symlink.patch broke the case of dup_mmap failure. ie. mm->exe_file is copied by memcpy from oldmm and then be fput'ed by mmput/set_mm_exe_file.

YAMAMOTO Takashi

---

kernel/fork.c renamed from kernel/fork.c.BACKUP +0 -0
@@ -523,11 +526,12 @@ static struct mm_struct *dup_mm(struct t
 	if (init_new_context(tsk, mm))
 		goto fail_nocontext;
 

kernel/fork.c static struct mm_struct *dup_mm(struct t · line 537

Quoted 10 lines
kernel/fork.c renamed from kernel/fork.c.BACKUP +2 -1
+	dup_mm_exe_file(oldmm, mm);
+
 	err = dup_mmap(mm, oldmm);
 	if (err)
 		goto free_pt;
 
-	dup_mm_exe_file(oldmm, mm);
 	mm->hiwater_rss = get_mm_rss(mm);
 	mm->hiwater_vm = mm->total_vm;
 

Cheers,
-Matt Helsley

--
To unsubscribe, send a message with 'unsubscribe linux-mm' in the body to [email protected]. For more info on Linux MM,
see: http://www.linux-mm.org/ .
Don't email: <a href=mailto:"[email protected]"> [email protected] </a>