Re: [PATCH] New System call unshare (try 2)

From: Chris Wright
Date: Thu Oct 13 2005 - 05:14:15 EST

* Jamie Lokier (jamie@xxxxxxxxxxxxx) wrote:
> Janak Desai wrote:
> > Don't allow sighand unsharing if not unsharing vm
> Why not? It's permitted to clone with unshared sighand and shared vm,
> and it's useful too.

I think that one's just backwards. Although I do question how useful it
is to unshare sighand. Sharing vm is pretty intimate ;-)

> It's the combination shared sighand + unshared vm which is not
> allowed by clone - so I think that's what you should refuse.
> > Don't allow vm unsharing if task cloned with CLONE_THREAD
> It would be better to do what clone does, and say "don't allow sighand
> unsharing if task cloned with CLONE_THREAD". This is because
> CLONE_THREAD tasks must have shared signals.

Yes, I agree.

> In combination with the rule above for sighand (my rule, not yours),
> that implies "don't allow vm unsharing.." as a consequence.
> > Don't allow vm unsharing if the task is performing async io
> Why not?
> Async ios are tied to an mm (see lookup_ioctx in fs/aio.c), which may
> be shared among tasks. I see no reason why the async ios can't
> continue and be waited in on in other tasks that may be using the old mm.

My concern was the case where there are no other tasks. But I don't
think that's an issue other than having the aio effect of setting up
aio then exiting.

To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at
Please read the FAQ at