Openwall GNU/*/Linux - a small security-enhanced Linux distro for servers
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Thu, 3 Aug 2017 02:00:03 +0300 (MSK)
From: Alexander Monakov <amonakov@...ras.ru>
To: musl@...ts.openwall.com
Subject: Re: possible bug in setjmp implementation for ppc64

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.
Alexander

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.