From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-1.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_MSPIKE_H2 autolearn=ham autolearn_force=no version=3.4.4 Received: (qmail 12989 invoked from network); 7 Oct 2022 12:24:53 -0000 Received: from second.openwall.net (193.110.157.125) by inbox.vuxu.org with ESMTPUTF8; 7 Oct 2022 12:24:53 -0000 Received: (qmail 32586 invoked by uid 550); 7 Oct 2022 12:24:49 -0000 Mailing-List: contact musl-help@lists.openwall.com; run by ezmlm Precedence: bulk List-Post: List-Help: List-Unsubscribe: List-Subscribe: List-ID: Reply-To: musl@lists.openwall.com Received: (qmail 32551 invoked from network); 7 Oct 2022 12:24:48 -0000 DKIM-Filter: OpenDKIM Filter v2.11.0 mail.ispras.ru 7B2DB40786C4 From: Alexey Izbyshev To: musl@lists.openwall.com Date: Fri, 7 Oct 2022 15:23:57 +0300 Message-Id: <20221007122357.75612-1-izbyshev@ispras.ru> X-Mailer: git-send-email 2.37.2 MIME-Version: 1.0 Mail-Followup-To: musl@lists.openwall.com Content-Transfer-Encoding: 8bit Subject: [musl] [PATCH] fix use of uninitialized dummy_fut in aio_suspend aio_suspend waits on a dummy futex in the corner case when the array of requests contains NULL pointers only. But the value of this futex was left uninitialized, so if it happens to be non-zero, aio_suspend degrades to spinning instead of blocking. --- src/aio/aio_suspend.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/aio/aio_suspend.c b/src/aio/aio_suspend.c index 1c1060e3..290b43f2 100644 --- a/src/aio/aio_suspend.c +++ b/src/aio/aio_suspend.c @@ -9,7 +9,7 @@ int aio_suspend(const struct aiocb *const cbs[], int cnt, const struct timespec { int i, tid = 0, ret, expect = 0; struct timespec at; - volatile int dummy_fut, *pfut; + volatile int dummy_fut = 0, *pfut; int nzcnt = 0; const struct aiocb *cb = 0; -- 2.37.2