The result is a kernel memory corruption, and kernel memory corruptions
are always the kernel's problem.
The code assumed that a semaphore id is globally unique. With
namespaces, this is not true anymore.
If two semaphore arrays exist with the same id, but different sizes,
then semops will cause memory corruptions: The undo structure contains
one element for each semaphore, thus the semop will write behind the end
of the memory allocation.
A very tricky question: Let's assume we have a process with two threads.
The undo structure is shared, as per opengroup standard.
Now one thread calls unshare(CLONE_NEWIPC). What should happen? We
cannot destroy the undo structure, the other thread might be still
interested in it.
If we allow sys_unshare() for multithreaded processes with CLONE_NEWIPC
and without CLONE_SYSVSEM, then we must handle this case.
--
Manfred
--