unofficial mirror of libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: Florian Weimer via Libc-alpha <libc-alpha@sourceware.org>
To: Andrew Cooper <andrew.cooper3@citrix.com>
Cc: libc-alpha@sourceware.org, xen-devel@lists.xenproject.org
Subject: Re: -mno-tls-direct-seg-refs support in glibc for i386 PV Xen
Date: Wed, 27 May 2020 16:20:49 +0200	[thread overview]
Message-ID: <87sgflh326.fsf@oldenburg2.str.redhat.com> (raw)
In-Reply-To: <3c6c1ab3-e9d9-78d1-8a1e-36da206c4c98@citrix.com> (Andrew Cooper's message of "Wed, 27 May 2020 15:15:27 +0100")

* Andrew Cooper:

> Oh, so the i386 TLS model relies on the calculation wrapping (modulo 4G)
> when the segment limit is 4G, instead of taking a fault?

That's about it.

> Intel states this is behaviour is implementation specific (SDM Vol3
> 5.3.1) and may fault, while AMD doesn't discuss it at all as far as I
> can tell (APM Vol2 4.12 is the right section, but I can't see this
> discussed).
>
> While I can believe it probably works on every processor these days, it
> does seem like dodgy ground to base an ABI on.

Sure, but it has been this way since the beginnings of NPTL, for close
to twenty years now.  The TCB is at positive offsets, and the user TLS
data at negative offsets.

> It also means that Xen isn't necessarily the only affected party.  I'm
> pretty sure GRSecurity use reduced segment limits as well.

Mostly for CS and DS, I believe, for the fake NX handling.  I think that
was never upstream, but some vendor kernels had variants of it.

> I also bet it doesn't work reliably under emulation.

It has to, given that it's so pervasively used under Linux. 8-/

Thanks,
Florian


  reply	other threads:[~2020-05-27 14:21 UTC|newest]

Thread overview: 8+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-05-27 13:03 -mno-tls-direct-seg-refs support in glibc for i386 PV Xen Florian Weimer via Libc-alpha
2020-05-27 13:39 ` Andrew Cooper via Libc-alpha
2020-05-27 13:44   ` Samuel Thibault
2020-05-27 14:15     ` Andrew Cooper via Libc-alpha
2020-05-27 14:20       ` Florian Weimer via Libc-alpha [this message]
2020-05-27 14:00   ` Jan Beulich
2020-05-27 14:40     ` Andrew Cooper via Libc-alpha
2020-05-27 15:25       ` Jan Beulich

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

  List information: https://www.gnu.org/software/libc/involved.html

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=87sgflh326.fsf@oldenburg2.str.redhat.com \
    --to=libc-alpha@sourceware.org \
    --cc=andrew.cooper3@citrix.com \
    --cc=fweimer@redhat.com \
    --cc=xen-devel@lists.xenproject.org \
    /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.
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 read-only IMAP folder(s) and NNTP newsgroup(s).