From: Manfred Spraul Date: Tue, 29 Apr 2008 08:00:59 +0000 (-0700) Subject: ipc: sysvsem: force unshare(CLONE_SYSVSEM) when CLONE_NEWIPC X-Git-Tag: v2.6.26-rc1~531 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=6013f67fc1a4c7fa5bcab2d39c1eaa3e260c7ac1;p=pandora-kernel.git ipc: sysvsem: force unshare(CLONE_SYSVSEM) when CLONE_NEWIPC sys_unshare(CLONE_NEWIPC) doesn't handle the undo lists properly, this can cause a kernel memory corruption. CLONE_NEWIPC must detach from the existing undo lists. Fix, part 2: perform an implicit CLONE_SYSVSEM in CLONE_NEWIPC. CLONE_NEWIPC creates a new IPC namespace, the task cannot access the existing semaphore arrays after the unshare syscall. Thus the task can/must detach from the existing undo list entries, too. This fixes the kernel corruption, because it makes it impossible that undo records from two different namespaces are in sysvsem.undo_list. Signed-off-by: Manfred Spraul Signed-off-by: Serge E. Hallyn Acked-by: "Eric W. Biederman" Cc: Pavel Emelyanov Cc: Michael Kerrisk Cc: Pierre Peiffer Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed