Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 11 Sep 2019 13:29:19 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: Re: 答复: Subject: [PATCH] pthread: Fix bug that
 pthread_create may cause priority inversion

On Wed, Sep 11, 2019 at 09:52:00AM -0400, Rich Felker wrote:
> On Wed, Sep 11, 2019 at 01:38:38PM +0000, zhaohang (F) wrote:
> > Thank you Rich for your patch. It helps me a lot.
> > 
> > But I find that 'return 0' is used to let child thread exit. In that
> > case, a bad thing will happen that the return address of child
> > thread maybe undefined, if caller set prio of child unsuccessfully.
> 
> The code in __clone is supposed to perform SYS_exit if the start
> function returns; this actually matters for users of the public
> clone() function, I think.

I found the problem -- when clone.s is built as thumb, mov lr,pc is
invalid for saving the return address (it omits the thumb-mode bit).
I have a patch I'll push soon, attached. Thanks again for the report!

Rich

View attachment "0001-fix-code-path-where-child-function-returns-in-arm-__.patch" of type "text/plain" (1318 bytes)

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.