patch-2.0.19 linux/arch/alpha/mm/fault.c
Next file: linux/arch/i386/kernel/Makefile
Previous file: linux/arch/alpha/kernel/ptrace.c
Back to the patch index
Back to the overall index
- Lines: 36
- Date:
Mon Sep 9 21:04:56 1996
- Orig file:
v2.0.18/linux/arch/alpha/mm/fault.c
- Orig date:
Thu Aug 1 15:53:34 1996
diff -u --recursive --new-file v2.0.18/linux/arch/alpha/mm/fault.c linux/arch/alpha/mm/fault.c
@@ -58,8 +58,11 @@
struct pt_regs regs)
{
struct vm_area_struct * vma;
+ struct task_struct *tsk = current;
+ struct mm_struct *mm = tsk->mm;
- vma = find_vma(current, address);
+ down(&mm->mmap_sem);
+ vma = find_vma(mm, address);
if (!vma)
goto bad_area;
if (vma->vm_start <= address)
@@ -85,6 +88,7 @@
goto bad_area;
}
handle_mm_fault(vma, address, cause > 0);
+ up(&mm->mmap_sem);
return;
/*
@@ -92,11 +96,12 @@
* Fix it, but check if it's kernel or user first..
*/
bad_area:
+ up(&mm->mmap_sem);
if (user_mode(®s)) {
printk("%s: memory violation at pc=%08lx rp=%08lx (bad address = %08lx)\n",
- current->comm, regs.pc, regs.r26, address);
+ tsk->comm, regs.pc, regs.r26, address);
die_if_kernel("oops", ®s, cause);
- force_sig(SIGSEGV, current);
+ force_sig(SIGSEGV, tsk);
return;
}
/*
FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov