From: Oleg Nesterov Date: Sat, 18 Mar 2006 17:41:10 +0000 (+0300) Subject: [PATCH] disable unshare(CLONE_VM) for now X-Git-Tag: v2.6.16~7 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=2d61b86775a5676a8fba2ba2f0f869564e35c630;p=linux-2.6-omap-h63xx.git [PATCH] disable unshare(CLONE_VM) for now sys_unshare() does mmput(new_mm). This is not enough if we have mm->core_waiters. This patch is a temporary fix for soon to be released 2.6.16. Signed-off-by: Oleg Nesterov [ Checked with Uli: "I'm not planning to use unshare(CLONE_VM). It's not needed for any functionality planned so far. What we (as in Red Hat) need unshare() for now is the filesystem side." ] Signed-off-by: Linus Torvalds --- diff --git a/kernel/fork.c b/kernel/fork.c index 46060cb24af..b373322ca49 100644 --- a/kernel/fork.c +++ b/kernel/fork.c @@ -1478,9 +1478,7 @@ static int unshare_vm(unsigned long unshare_flags, struct mm_struct **new_mmp) if ((unshare_flags & CLONE_VM) && (mm && atomic_read(&mm->mm_users) > 1)) { - *new_mmp = dup_mm(current); - if (!*new_mmp) - return -ENOMEM; + return -EINVAL; } return 0;