Skip to contentSkip to conversation

syslets: x86, mark async unsafe syscalls

PATCH In review Ingo Molnar 1 participant 1 message Feb 15, 2007

lore
Share & tools
lore
#0 lore raw

PATCH 10/14 syslets: x86, mark async unsafe syscalls

From: Ingo Molnar <[email protected]>

mark clone() and fork() as not available for async execution. Both need an intact user context beneath them to work.

---
 arch/i386/kernel/process.c |    6 ++++++
 1 file changed, 6 insertions(+)
arch/i386/kernel/process.c +6 -0
Index: linux/arch/i386/kernel/process.c
===================================================================
@@ -731,6 +731,9 @@ struct task_struct fastcall * __switch_t
 
 asmlinkage int sys_fork(struct pt_regs regs)
 {
+	if (async_syscall(current))
+		return -ENOSYS;
+
 	return do_fork(SIGCHLD, regs.esp, &regs, 0, NULL, NULL);
 }
 
@@ -740,6 +743,9 @@ asmlinkage int sys_clone(struct pt_regs 
 	unsigned long newsp;
 	int __user *parent_tidptr, *child_tidptr;
 
+	if (async_syscall(current))
+		return -ENOSYS;
+
 	clone_flags = regs.ebx;
 	newsp = regs.ecx;
 	parent_tidptr = (int __user *)regs.edx;