linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: hpa@zytor.com
To: Andy Lutomirski <luto@kernel.org>
Cc: "Robert O'Callahan" <robert@ocallahan.org>,
	"Bae, Chang Seok" <chang.seok.bae@intel.com>,
	Kyle Huey <me@kylehuey.com>, Thomas Gleixner <tglx@linutronix.de>,
	Ingo Molnar <mingo@kernel.org>, Andi Kleen <ak@linux.intel.com>,
	"Shankar, Ravi V" <ravi.v.shankar@intel.com>,
	LKML <linux-kernel@vger.kernel.org>,
	"Hansen, Dave" <dave.hansen@intel.com>
Subject: Re: [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system
Date: Tue, 25 Aug 2020 08:13:51 -0700	[thread overview]
Message-ID: <F1D9A90A-A2D5-47E4-8E33-410460FCD6CC@zytor.com> (raw)
In-Reply-To: <CALCETrXvgb257CWnaA1NgUUp3x08+gJBEOQh4o9OYkB-RvAo1A@mail.gmail.com>

On August 24, 2020 5:30:56 PM PDT, Andy Lutomirski <luto@kernel.org> wrote:
>On Mon, Aug 24, 2020 at 4:52 PM H. Peter Anvin <hpa@zytor.com> wrote:
>>
>> On 2020-08-24 14:10, Andy Lutomirski wrote:
>> >
>> > PTRACE_READ_SEGMENT_DESCRIPTOR to read a segment descriptor.
>> >
>> > PTRACE_SET_FS / PTRACE_SET_GS: Sets FS or GS and updates the base
>accordingly.
>> >
>> > PTRACE_READ_SEGMENT_BASE: pass in a segment selector, get a base
>out.
>> > You would use this to populate the base fields.
>> >
>> > or perhaps a ptrace SETREGS variant that tries to preserve the old
>> > base semantics and magically sets the bases to match the selectors
>if
>> > the selectors are nonzero.
>> >
>> > Do any of these choices sound preferable to any of you?
>> >
>>
>> My suggestion would be to export the GDT and LDT as a (readonly or
>mostly
>> readonly) regset(s) rather than adding entirely new operations. We
>could allow
>> the LDT and the per-thread GDT entries to be written, subject to the
>same
>> limitations as the corresponding system calls.
>>
>
>That seems useful, although we'd want to do some extensive
>sanitization of the GDT.  But maybe it's obnoxious to ask Kyle and
>Robert to parse the GDT, LDT, and selector just to emulate the
>demented pre-5.9 ptrace() behavior.
>
>--Andy

We only want to allow the same access that user space gets, that's exactly the sanitization we need.
-- 
Sent from my Android device with K-9 Mail. Please excuse my brevity.

  parent reply	other threads:[~2020-08-25 15:14 UTC|newest]

Thread overview: 18+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
     [not found] <CAOp6jLYrwMqV=7hmxgdZUdDZ2aeUB27TTHm=j6cQT7C10Muhww@mail.gmail.com>
     [not found] ` <7DF88F22-0310-40C9-9DA6-5EBCB4877933@amacapital.net>
2020-08-24 21:10   ` [REGRESSION] x86/cpu fsgsbase breaks TLS in 32 bit rr tracees on a 64 bit system Andy Lutomirski
2020-08-24 23:52     ` H. Peter Anvin
2020-08-25  0:30       ` Andy Lutomirski
2020-08-25  0:46         ` Kyle Huey
2020-08-25 16:12           ` Andy Lutomirski
2020-08-25 16:32             ` Kyle Huey
2020-08-25 16:46               ` Andy Lutomirski
2020-08-25 17:31                 ` Kyle Huey
2020-08-25 18:50                   ` Kyle Huey
2020-08-25 19:32                     ` Andy Lutomirski
2020-08-25 20:03                       ` Kyle Huey
2020-08-25 15:13         ` hpa [this message]
2020-08-21  4:41 Kyle Huey
2020-08-21 20:08 ` Bae, Chang Seok
2020-08-21 21:32   ` Kyle Huey
2020-08-21 21:46     ` Bae, Chang Seok
2020-08-22  2:53     ` Andy Lutomirski
2020-08-22  3:03       ` Kyle Huey

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=F1D9A90A-A2D5-47E4-8E33-410460FCD6CC@zytor.com \
    --to=hpa@zytor.com \
    --cc=ak@linux.intel.com \
    --cc=chang.seok.bae@intel.com \
    --cc=dave.hansen@intel.com \
    --cc=linux-kernel@vger.kernel.org \
    --cc=luto@kernel.org \
    --cc=me@kylehuey.com \
    --cc=mingo@kernel.org \
    --cc=ravi.v.shankar@intel.com \
    --cc=robert@ocallahan.org \
    --cc=tglx@linutronix.de \
    /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 NNTP newsgroup(s).