From: Fangrui Song <i@maskray.me>
To: musl@lists.openwall.com
Cc: Rich Felker <dalias@libc.org>
Subject: Re: [musl] SIGSEGV with TEXTREL
Date: Fri, 25 Sep 2020 21:14:18 -0700 [thread overview]
Message-ID: <MWHPR12MB14565F0304AC494494AC9F34CB370@MWHPR12MB1456.namprd12.prod.outlook.com> (raw)
In-Reply-To: <b80c7eea-8252-9de4-9e1b-aa21021de7f3@gmail.com>
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.)
next prev parent reply other threads:[~2020-09-26 4:14 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 [this message]
2020-09-26 9:09 ` Szabolcs Nagy
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=MWHPR12MB14565F0304AC494494AC9F34CB370@MWHPR12MB1456.namprd12.prod.outlook.com \
--to=i@maskray.me \
--cc=dalias@libc.org \
--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).