Duh, I overlooked that part. You are right.
Thus all apps right now call unshare(CLONE_NEWIPC|&~CLONE_SYSVSEM).
This combination doesn't make much sense. Even worse - it easily causes a kernel oops.
Thus my fix is twofold:
- add support for unshare(CLONE_SYSVSEM).
- implicitely add CLONE_SYSVSEM to all calls that set CLONE_NEWIPC.
Right but your fix ignores the fact that you can achieve the same
result as unshare(CLONE_NEWIPC&~CLONE_SYSVSEM) by doing
clone(CLONE_NEWIPC|CLONE_SYSVSEM).
It's only 99% silly: a task might want to have not-yet undone changes in its parent's namespace.I have decided against that, it breaks the current ABI.
And we gain virtually nothing - most if not all unshare users will be single threaded apps that do not use sysvsem at all, and even most sysvsem users do not use SEM_UNDO.
And most importantly sharing your semundo list but not your sems with
your parent is silly!