Skip to contentSkip to conversation

PATCH 2.4.18-rc2-ac1: hang on spinlock in "expand_stack"

PATCH Kevin Buhr 2 participants 2 messages Mar 3, 2002

Subsystems (2)
lore
Share & tools
lore

Kevin Buhr

author
#0 lore raw

Alan:

I've enclosed a patch against 2.4.18-rc2-ac1, but it appears the same bug still exists in 2.4.19-pre1-ac1. The "ac"-branch version of "expand_stack" in "mm/mmap.c" has a code path that doesn't unlock the spinlock. I noticed when a "gdb" bug tickled it and locked up my machine.

Kevin Buhr <[email protected]>

* * *

mm/mmap.c +3 -1
@@ -762,8 +762,10 @@
 	grow = (vma->vm_start - address) >> PAGE_SHIFT;
 
 	/* Overcommit.. */
-	if(!vm_enough_memory(grow, 1))
+	if(!vm_enough_memory(grow, 1)) {
+		spin_unlock(&vma->vm_mm->page_table_lock);
 		return -ENOMEM;
+	}
 	
 	if (vma->vm_end - address > current->rlim[RLIMIT_STACK].rlim_cur ||
 	    ((vma->vm_mm->total_vm + grow) << PAGE_SHIFT) > current->rlim[RLIMIT_AS].rlim_cur) {
#1 lore raw
Quoted 5 lines

I've enclosed a patch against 2.4.18-rc2-ac1, but it appears the same bug still exists in 2.4.19-pre1-ac1. The "ac"-branch version of "expand_stack" in "mm/mmap.c" has a code path that doesn't unlock the spinlock. I noticed when a "gdb" bug tickled it and locked up my machine.

Thanks. Thats one I accidentally introduced when I was doing the strict oom handling. I'll apply that