Serge E. Hallyn wrote: >> diff --git a/ipc/namespace.c b/ipc/namespace.c >> index 9171d94..9044505 100644 >> --- a/ipc/namespace.c >> +++ b/ipc/namespace.c >> @@ -48,6 +48,16 @@ struct ipc_namespace *copy_ipcs(unsigned long flags, struct ipc_namespace *ns) >> if (!(flags & CLONE_NEWIPC)) >> return ns; >> >> + if (!(flags & CLONE_SYSVSEM)) { >> > > Wait, this should be opposite, right? > > [snip] > Manfred, I'm trying to test this, but can't get an error without this > patch. Do you have a testcase? The patch is bogus, sorry that I didn't notice it immediately. The problem is ipc/sem.c, function find_undo, lookup_undo: lookup_undo doesn't check the namespace pointer, thus a simple single threaded app can trigger the problem. Attached is a test app and a kernel patch that shows the problem. Run the test app immediately after boot (or within a new ipc namespace), otherwise the ipc sequence counter will prevent the app from triggering the problem: The undo structure that was created before unshare() [i.e. with 1 semaphore in it] will be used after unshare() [i.e. semaphore 100 will be accessed]. With kernel debugging (full slub debugging) enabled, I even got an oops when I tried to ipcrm the left over array after running undons, probably because the undo structure was freed at exit_sem() within the new namespace, but still used in the outer namespace. -- Manfred