mailing list of musl libc
 help / color / mirror / code / Atom feed
From: Markus Wichmann <nullplan@gmx.net>
To: musl@lists.openwall.com
Cc: Peter Williams <peter@newton.cx>
Subject: Re: [musl] aarch64 sigsetjmp relocation truncation bug, maybe
Date: Thu, 7 Sep 2023 16:42:50 +0200	[thread overview]
Message-ID: <ZPnhasrLJYEGaUt5@voyager> (raw)
In-Reply-To: <20230907124828.GB4163@brightrain.aerifal.cx>

Am Thu, Sep 07, 2023 at 08:48:28AM -0400 schrieb Rich Felker:
> Are you sure this is the actual problem? I think it's that the aarch64
> (and several other archs) version of sigsetjmp is wrongly using the
> public setjmp symbol whose definition is possibly provided by a PLT
> thunk in the main program, rather than either setjmp@PLT (which would
> necessarily be the right local call point to use) or the hidden
> ___setjmp symbol that exists for this purpose (which i386, for
> example, uses).
>
> Rich

No I am not sure. I wrote that patch before heading to work, without
even test-compiling, and I don't know the first thing about arm64. But
every architecture I have ever looked into at any depth had a shorter
conditional branch than unconditional branch, and the linker normally
presumes to be able to rearrange input code sections at will, at least
for the branch length of an unconditional branch. Anything more usually
requires more specialized code and specialized options to the compiler.
That's why I wrote the patch in that way.

Of course you are right that I did not think about the PLT, or a
possible symbol interposition. However, the subroutine call to setjmp
that was already in sigsetjmp also didn't. And the prior version of the
code as well. So at least I didn't worsen the situation.

Ciao,
Markus

      parent reply	other threads:[~2023-09-07 14:43 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-09-07  0:46 Peter Williams
2023-09-07  1:01 ` [musl] " Peter Williams
2023-09-07  3:08 ` [musl] " Markus Wichmann
2023-09-07 12:48   ` Rich Felker
2023-09-07 13:28     ` Rich Felker
2023-09-07 19:49       ` Szabolcs Nagy
2023-09-07 14:42     ` Markus Wichmann [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=ZPnhasrLJYEGaUt5@voyager \
    --to=nullplan@gmx.net \
    --cc=musl@lists.openwall.com \
    --cc=peter@newton.cx \
    /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).