From: Manfred Spraul Date: Tue, 26 Jul 2011 00:11:47 +0000 (-0700) Subject: ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID X-Git-Tag: v3.1-rc1~241^2~121 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=d694ad62bf539dbb20a0899ac2a954555f9e4a83;p=pandora-kernel.git ipc/sem.c: fix race with concurrent semtimedop() timeouts and IPC_RMID If a semaphore array is removed and in parallel a sleeping task is woken up (signal or timeout, does not matter), then the woken up task does not wait until wake_up_sem_queue_do() is completed. This will cause crashes, because wake_up_sem_queue_do() will read from a stale pointer. The fix is simple: Regardless of anything, always call get_queue_result(). This function waits until wake_up_sem_queue_do() has finished it's task. Addresses https://bugzilla.kernel.org/show_bug.cgi?id=27142 Reported-by: Yuriy Yevtukhov Reported-by: Harald Laabs Signed-off-by: Manfred Spraul Acked-by: Eric Dumazet Cc: [2.6.35+] Signed-off-by: Andrew Morton Signed-off-by: Linus Torvalds --- Reading git-diff-tree failed