From mboxrd@z Thu Jan 1 00:00:00 1970 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on inbox.vuxu.org X-Spam-Level: X-Spam-Status: No, score=-2.0 required=5.0 tests=MAILING_LIST_MULTI, RCVD_IN_DNSWL_MED,RCVD_IN_MSPIKE_H3,RCVD_IN_MSPIKE_WL,RDNS_NONE, SPF_PASS autolearn=ham autolearn_force=no version=3.4.2 Received: (qmail 3554 invoked from network); 27 Mar 2020 18:17:14 -0000 Received-SPF: pass (mother.openwall.net: domain of lists.openwall.com designates 195.42.179.200 as permitted sender) receiver=inbox.vuxu.org; client-ip=195.42.179.200 envelope-from= Received: from unknown (HELO mother.openwall.net) (195.42.179.200) by inbox.vuxu.org with ESMTP; 27 Mar 2020 18:17:14 -0000 Received: (qmail 28276 invoked by uid 550); 27 Mar 2020 18:17:08 -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 28252 invoked from network); 27 Mar 2020 18:17:07 -0000 Date: Fri, 27 Mar 2020 14:16:54 -0400 From: Rich Felker To: musl@lists.openwall.com Cc: Leonid Shamis Message-ID: <20200327181654.GH11469@brightrain.aerifal.cx> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.5.21 (2010-09-15) Subject: Re: [musl] __pthread_mutex_unlock uninitialized value On Fri, Mar 27, 2020 at 10:52:58AM -0700, Leonid Shamis wrote: > https://github.com/bminor/musl/blob/54ca677983d47529bab8752315ac1a2b49888870/src/thread/pthread_mutex_unlock.c#L34 BTW official git is here: https://git.musl-libc.org/cgit/musl/tree/src/thread/pthread_mutex_unlock.c?id=v1.2.0 > In the case where a mutex: > is one of PTHREAD_MUTEX_ERRORCHECK or PTHREAD_MUTEX_RECURSIVE > and PTHREAD_PRIO_INHERIT > > an uninitialized value of 'old' is used to check whether to futex. Can you elaborate on this? In line 15, old is assigned; this applies to all mutex types except plain boring normal (without PI and without robust). The condition in line 33 can only be true if type is nonzero (not plain boring normal mutex) so I don't see any way it can be used uninitialized in line 34. Is your report based on your own reading or a static analysis tool? Rich