From: Szabolcs Nagy <nsz@port70.net>
To: Fangrui Song <i@maskray.me>
Cc: musl@lists.openwall.com, Rich Felker <dalias@libc.org>
Subject: Re: [musl] SIGSEGV with TEXTREL
Date: Sat, 26 Sep 2020 11:09:52 +0200 [thread overview]
Message-ID: <20200926090952.GK2947641@port70.net> (raw)
In-Reply-To: <MWHPR12MB14565F0304AC494494AC9F34CB370@MWHPR12MB1456.namprd12.prod.outlook.com>
* Fangrui Song <i@maskray.me> [2020-09-25 21:14:18 -0700]:
> On Fri, Sep 25, 2020 at 7:53 PM Dominic Chen <d.c.ddcc@gmail.com> wrote:
> >
> > On 9/25/2020 6:46 PM, Rich Felker wrote:
> > >
> > > The right way to make this more friendly, I think, would be tracking
> > > the writable mapping range for each DSO (technically this is
> > > incomplete since it could be multiple ranges, but in that case we'd
> > > just take the convex hull of them and accept false negatives because
> > > anything else is almost surely too big a performance hit), and
> > > erroring out before processing a relocation at an address that's not
> > > writable for its DSO. This would also go part of the way towards
> > > making it possible for ldd to process untrusted files.
> >
> > I agree that that seems to be a better solution, and it was also
> > discussed in the previous mailing list thread. But my point is just that
> > given how this issue has been reoccurring, I think it'd be useful to do
> > something now (e.g. emit a non-fail warning if TEXTRELs are present),
> > rather than deferring any changes.
> >
> > Thanks,
> >
> > Dominic
>
> binutils 2.35 can be configured with --enable-textrel-check=yes, and
> Linux/x86 defaults to 'yes'. ld emits a warning upon a text
> relocation:
>
> warning: creating DT_TEXTREL in a PIE
>
> (LLD always disallows text relocations by default (-z text). You need
> -z notext to enable DF_TEXTREL and text relocations.)
nice
and gcc passes -z text for static pie code so that case should
not end up with text rels.
prev parent reply other threads:[~2020-09-26 9:10 UTC|newest]
Thread overview: 9+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-09-25 3:50 Dominic Chen
2020-09-25 9:37 ` Szabolcs Nagy
2020-09-25 18:58 ` Rich Felker
2020-09-25 20:13 ` Dominic Chen
2020-09-25 20:49 ` Markus Wichmann
2020-09-25 22:46 ` Rich Felker
2020-09-26 0:32 ` Dominic Chen
2020-09-26 4:14 ` Fangrui Song
2020-09-26 9:09 ` Szabolcs Nagy [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20200926090952.GK2947641@port70.net \
--to=nsz@port70.net \
--cc=dalias@libc.org \
--cc=i@maskray.me \
--cc=musl@lists.openwall.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/musl/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).