Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Date: Tue, 18 Oct 2022 12:49:27 +0000
From: "Zhaohaifeng(Clark,IAS-SWP)" <zhaohaifeng4@...wei.com>
To: "musl@...ts.openwall.com" <musl@...ts.openwall.com>
Subject: A question about a patch of __vm_wait and thread list lock in musl

Hi there

I am reading the following patch, https://git.musl-libc.org/cgit/musl/commit/?id=d26e0774a59bb7245b205bc8e7d8b35cc2037095, it says that "the __vm_wait operation can delay forward progress arbitrarily long if a thread holding the lock is interrupted by a signal. in a worst case this can deadlock." So the patch puts the vm wait before the thread list lock.

I am wondering about the deadlock scenario. We guess the deadlock occurs like that one thread doing the pthread_exit holds the thread list lock and waits for the vm lock, and another thread holding the vm lock is interrupted by a signal and tries to hold the thread list lock in the signal handler.
But the thread list lock related functions are all AS-unsafe and shall not be called in signal hanlder. Further in musl before holding the thread list lock, the application signals are all blocked. So it seems the deadlock scenario does not exist.

Is my conclusion right?

BR
Clark Zhao

Content of type "text/html" skipped

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.