mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Rich Felker <dalias@libc.org>
To: musl@lists.openwall.com
Cc: Leonid Shamis <leonid.shamis@gmail.com>
Subject: Re: [musl] __pthread_mutex_unlock uninitialized value
Date: Fri, 27 Mar 2020 14:16:54 -0400	[thread overview]
Message-ID: <20200327181654.GH11469@brightrain.aerifal.cx> (raw)
In-Reply-To: <CAHSMefhR1ze9sVtiNV6Lajjs_m6bJd3C1DP=tBxW-HTL2e6-+g@mail.gmail.com>

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

  reply	other threads:[~2020-03-27 18:17 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-27 17:52 Leonid Shamis
2020-03-27 18:16 ` Rich Felker [this message]
2020-03-27 18:23   ` Leonid Shamis

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20200327181654.GH11469@brightrain.aerifal.cx \
    --to=dalias@libc.org \
    --cc=leonid.shamis@gmail.com \
    --cc=musl@lists.openwall.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
Code repositories for project(s) associated with this public inbox

	https://git.vuxu.org/mirror/musl/

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).