[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrWZhXgq9akoh5UXiTMbPXfw-9GSuV3CiTQan3Yr6WdiMQ@mail.gmail.com>
Date: Fri, 8 Dec 2017 08:47:34 -0800
From: Andy Lutomirski <luto@...nel.org>
To: David Laight <David.Laight@...lab.com>
Cc: Andy Lutomirski <luto@...nel.org>,
Peter Zijlstra <peterz@...radead.org>,
Thomas Gleixner <tglx@...utronix.de>,
Ingo Molnar <mingo@...nel.org>, Borislav Petkov <bp@...en8.de>,
X86 ML <x86@...nel.org>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
Brian Gerst <brgerst@...il.com>,
Kees Cook <keescook@...omium.org>
Subject: Re: [PATCH] LDT improvements
On Fri, Dec 8, 2017 at 8:46 AM, David Laight <David.Laight@...lab.com> wrote:
> From: Andy Lutomirski
>> Sent: 08 December 2017 16:34
>
>> #GP on IRET is a failure, and we have disgusting code to handle it.
>
> Is that the trap in kernel space when the on-stack segment registers
> are invalid?
> Definitely needs horrid code...
>
>> #PF on IRET would not be a failure -- it's a case where IRET should be
>> retried. Our crap that fixes up #GP would get that wrong and leave us
>> with the wrong GSBASE.
>
> If the user code page isn't present then the fault happens after the
> return to user mode, not on the IRET instruction in kernel mode.
> So it is not really any different to returning to a NOP at the end
> of a resident page when the page following is absent.
> (Or any other invalid %ip value.)
I mean: if the user CS or SS is not accessed and the LDT is RO, then
we get #PF on the IRET instruction, I think. Dealing with that is
truly awful.
Powered by blists - more mailing lists