patch-2.1.113 linux/arch/m68k/kernel/sys_m68k.c

Next file: linux/arch/m68k/mac/config.c
Previous file: linux/arch/m68k/kernel/signal.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.112/linux/arch/m68k/kernel/sys_m68k.c linux/arch/m68k/kernel/sys_m68k.c
@@ -66,6 +66,7 @@
 	struct file * file = NULL;
 	struct mmap_arg_struct a;
 
+	down(&current->mm->mmap_sem);
 	lock_kernel();
 	error = -EFAULT;
 	if (copy_from_user(&a, arg, sizeof(a)))
@@ -78,11 +79,13 @@
 			goto out;
 	}
 	a.flags &= ~(MAP_EXECUTABLE | MAP_DENYWRITE);
+
 	error = do_mmap(file, a.addr, a.len, a.prot, a.flags, a.offset);
 	if (file)
 		fput(file);
 out:
 	unlock_kernel();
+	up(&current->mm->mmap_sem);
 	return error;
 }
 

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov