Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Wed, 2 Aug 2017 19:02:57 -0400
From: Rich Felker <dalias@...c.org>
To: musl@...ts.openwall.com
Subject: Re: possible bug in setjmp implementation for ppc64

On Thu, Aug 03, 2017 at 02:00:03AM +0300, Alexander Monakov wrote:
> On Tue, 1 Aug 2017, David Edelsohn wrote:
> > "If glibc is built as a static library, the contents of r2 are saved
> > in the jmp_buf; but if glibc is built as a dynamic library, the
> > contents of the TOC save slot is saved in the jmp_buf.   Similarly, if
> > glibc is built as a dynamic library, longjmp *updates* the TOC save
> > slot with the r2 value from the jmp_buf before returning."
> > 
> > GLIBC setjmp/longjmp code explicitly differs for shared and static
> > versions of the library.  Musl libc needs equivalent functionality in
> > its implementation.
> 
> Note that since Glibc also supports static dlopen, it is possible to arrive
> at a situation where libc.a longjmp is used for returning to a call site
> of libc.so setjmp, in which case TOC save slot is not restored as it
> ought to be, and the caller of setjmp segfaults. A testcase is available at
> https://sourceware.org/bugzilla/show_bug.cgi?id=21895

Thanks for investigating and writing this up.

Rich

Powered by blists - more mailing lists

Your e-mail address:

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