2006-03-18 17:44:09

by Oleg Nesterov

[permalink] [raw]
Subject: [PATCH] for 2.6.16, disable unshare_vm()

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 <[email protected]>

--- MM/kernel/fork.c~ 2006-03-18 23:15:13.000000000 +0300
+++ MM/kernel/fork.c 2006-03-18 23:15:56.000000000 +0300
@@ -1512,9 +1512,7 @@ static int unshare_vm(unsigned long unsh

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;


2006-03-18 18:11:07

by Linus Torvalds

[permalink] [raw]
Subject: Re: [PATCH] for 2.6.16, disable unshare_vm()



On Sat, 18 Mar 2006, Oleg Nesterov wrote:
>
> 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.

Yes. Quick raising of hands: is there anybody out there that expects to
use unshare(CLONE_VM) right now? One of the reasons it was integrated was
that I thought glibc wanted it for distros. Is disabling the CLONE_VM
unsharing going to impact that?

Linus

2006-03-18 18:30:12

by Ulrich Drepper

[permalink] [raw]
Subject: Re: [PATCH] for 2.6.16, disable unshare_vm()

Linus Torvalds wrote:
> Yes. Quick raising of hands: is there anybody out there that expects to
> use unshare(CLONE_VM) right now? One of the reasons it was integrated was
> that I thought glibc wanted it for distros. Is disabling the CLONE_VM
> unsharing going to impact that?

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.

--
➧ Ulrich Drepper ➧ Red Hat, Inc. ➧ 444 Castro St ➧ Mountain View, CA ❖


Attachments:
signature.asc (253.00 B)
OpenPGP digital signature

2006-03-18 18:48:54

by Janak Desai

[permalink] [raw]
Subject: Re: [PATCH] for 2.6.16, disable unshare_vm()

Linus Torvalds wrote:

>On Sat, 18 Mar 2006, Oleg Nesterov wrote:
>
>
>>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.
>>
>>
>
>Yes. Quick raising of hands: is there anybody out there that expects to
>use unshare(CLONE_VM) right now? One of the reasons it was integrated was
>that I thought glibc wanted it for distros. Is disabling the CLONE_VM
>unsharing going to impact that?
>
> Linus
>
>
>
We are using namespace and filesystem unsharing for our common criteria
certification work and would not be impacted by disabling of vm unsharing.

-Janak