Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <e158afa0-5576-5928-74b2-0b9f99e8fed6@gmail.com>
Date: Thu, 24 Sep 2020 23:50:19 -0400
From: Dominic Chen <d.c.ddcc@...il.com>
To: musl@...ts.openwall.com
Subject: SIGSEGV with TEXTREL

Please CC me on replies.

I recently discovered that musl doesn't support DT/DF_TEXTREL in the
main executable, which can result in the dynamic loader crashing with
SIGSEGV and SEGV_ACCERR while processing relocations. I spent a few days
trying to fix this in the toolchain, but because it is a prototype based
on Clang/LLVM 4.0.0 that adds runtime instrumentation built using the
x64 large code model, so it's not easy to fix. Also, glibc does support
this behavior.

I ended up implementing support for this in musl itself (patch
attached), but given the discussion in the previous thread, "Static
linking is broken after creation of DT_TEXTREL," it seems like this
isn't acceptable due to overhead? I don't quite understand the concern,
because the loader needs to iterate again over the program headers only
if the program contains TEXTRELs, which is strictly an improvement, even
if the iteration itself is suboptimal. Alternatively, I'd suggest that
musl at least warns about unsupported TEXTRELs if present, because
asking application developers to debug a crashing ELF loader is quite a
high bar.

Thanks,

Dominic


View attachment "musl-textrel.patch" of type "text/plain" (2064 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.