Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Mon, 06 Jul 2020 15:14:43 -0700
From: Hydro Flask <hydroflask@...mail.com>
To: Rich Felker <dalias@...c.org>
Cc: musl@...ts.openwall.com
Subject: Re: Potential deadlock in pthread_kill()

On 2020-07-06 15:00, Rich Felker wrote:
> Yes, I see it clearly now. Sorry it took a while. I have prepared the
> attached patch which I'll push soon if there are no problems.

Needs one more tiny tweak. I noticed that pthread_cancel() calls 
pthread_kill(). That means pthread_kill() must be async-cancel-safe. If 
an asynchronous cancellation happens after pthread_kill() grabs the 
killlock, then it will deadlock because the asynchronous 
pthread_exit(PTHREAD_CANCELED) call will then recursively try to grab 
killlock.

The solution as far as I can tell is to not just block app signals when 
grabbing killlock, but all signals.

Powered by blists - more mailing lists

Confused about mailing lists and their use? Read about mailing lists on Wikipedia and check out these guidelines on proper formatting of your messages.