Follow @Openwall on Twitter for new release announcements and other news
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Date: Fri, 25 Sep 2020 21:14:18 -0700
From: Fangrui Song <i@...kray.me>
To: musl@...ts.openwall.com
Cc: Rich Felker <dalias@...c.org>
Subject: Re: SIGSEGV with TEXTREL

On Fri, Sep 25, 2020 at 7:53 PM Dominic Chen <d.c.ddcc@...il.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.)

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.