Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754726Ab3FOOGy (ORCPT ); Sat, 15 Jun 2013 10:06:54 -0400 Received: from mail-bk0-f53.google.com ([209.85.214.53]:43344 "EHLO mail-bk0-f53.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1754438Ab3FOOGv (ORCPT ); Sat, 15 Jun 2013 10:06:51 -0400 From: Manfred Spraul To: Andrew Morton Cc: LKML , Rik van Riel , Davidlohr Bueso , hhuang@redhat.com, Linus Torvalds , Mike Galbraith , Manfred Spraul Subject: [PATCH] ipc/sem.c: scan complex wait-for-zero after undefined updates Date: Sat, 15 Jun 2013 16:06:24 +0200 Message-Id: <1371305184-14667-1-git-send-email-manfred@colorfullife.com> X-Mailer: git-send-email 1.8.1.4 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1121 Lines: 37 After an update of a semaphore array that does not use struct sembuf, complex wait-for-zero operations were not checked if they are able to proceed. Andrew: Could you add it to -mm? I've introduced the bug with ipc-sem-separate-wait-for-zero-and-alter-tasks-into-seperate-queues.patch Signed-off-by: Manfred Spraul --- ipc/sem.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/ipc/sem.c b/ipc/sem.c index f9d1c06..ad9daca 100644 --- a/ipc/sem.c +++ b/ipc/sem.c @@ -785,8 +785,10 @@ static int do_smart_wakeup_zero(struct sem_array *sma, struct sembuf *sops, * Assume all were changed. */ for (i = 0; i < sma->sem_nsems; i++) { - if (sma->sem_base[i].semval == 0) + if (sma->sem_base[i].semval == 0) { + got_zero = 1; semop_completed |= wake_const_ops(sma, i, pt); + } } } /* -- 1.8.1.4 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/