[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <CALCETrUtqOmFjj6ie8vaCuM6SX91BNotA-gwf90bUY9hj_qD1g@mail.gmail.com>
Date: Fri, 17 Mar 2017 11:20:51 -0700
From: Andy Lutomirski <luto@...nel.org>
To: Linus Torvalds <torvalds@...ux-foundation.org>
Cc: kernel test robot <xiaolong.ye@...el.com>,
Thomas Garnier <thgarnie@...gle.com>,
Ingo Molnar <mingo@...nel.org>,
Alexander Potapenko <glider@...gle.com>,
Andrew Morton <akpm@...ux-foundation.org>,
Andrey Ryabinin <aryabinin@...tuozzo.com>,
Andy Lutomirski <luto@...nel.org>,
Ard Biesheuvel <ard.biesheuvel@...aro.org>,
Boris Ostrovsky <boris.ostrovsky@...cle.com>,
Borislav Petkov <bp@...e.de>,
Chris Wilson <chris@...is-wilson.co.uk>,
Christian Borntraeger <borntraeger@...ibm.com>,
Dmitry Vyukov <dvyukov@...gle.com>,
Frederic Weisbecker <fweisbec@...il.com>,
Jiri Kosina <jikos@...nel.org>, Joerg Roedel <joro@...tes.org>,
Jonathan Corbet <corbet@....net>,
Josh Poimboeuf <jpoimboe@...hat.com>,
Juergen Gross <jgross@...e.com>,
Kees Cook <keescook@...omium.org>,
Len Brown <len.brown@...el.com>,
Lorenzo Stoakes <lstoakes@...il.com>,
"Luis R . Rodriguez" <mcgrof@...nel.org>,
Matt Fleming <matt@...eblueprint.co.uk>,
Michal Hocko <mhocko@...e.com>,
Paolo Bonzini <pbonzini@...hat.com>,
Paul Gortmaker <paul.gortmaker@...driver.com>,
Pavel Machek <pavel@....cz>,
Peter Zijlstra <peterz@...radead.org>,
Radim Krčmář <rkrcmar@...hat.com>,
"Rafael J . Wysocki" <rjw@...ysocki.net>,
Rusty Russell <rusty@...tcorp.com.au>,
Stanislaw Gruszka <sgruszka@...hat.com>,
Thomas Gleixner <tglx@...utronix.de>,
Tim Chen <tim.c.chen@...ux.intel.com>,
Vitaly Kuznetsov <vkuznets@...hat.com>,
zijun_hu <zijun_hu@....com>, LKML <linux-kernel@...r.kernel.org>,
"H. Peter Anvin" <hpa@...or.com>, tipbuild@...or.com,
LKP <lkp@...org>
Subject: Re: [x86] 45fc8757d1: BUG:unable_to_handle_kernel
On Fri, Mar 17, 2017 at 11:07 AM, Linus Torvalds
<torvalds@...ux-foundation.org> wrote:
> On Fri, Mar 17, 2017 at 11:00 AM, Linus Torvalds
> <torvalds@...ux-foundation.org> wrote:
>> On Fri, Mar 17, 2017 at 10:49 AM, Linus Torvalds
>> <torvalds@...ux-foundation.org> wrote:
>>>
>>> The linear address can be used to look up which entry it is. I assume
>>> the GDT starts at ffffffffff577000, and that this is at offset 0x60
>>> from that. Whatever descriptor that would be..
>>
>> Hmm. That should be gdt index 12, aka GDT_ENTRY_TLS_MIN.
>>
>> I guess user space can set almost anything there. Including setting a
>> segment type that isn't accessed, and that the CPU will change on the
>> first actual access.
>>
>> We do have code to verify the limits and types etc iirc, I guess we
>> can make sure to set the accessed bit too.
>
> Hmm. "fill_ldt()" does this:
>
> desc->type = (info->read_exec_only ^ 1) << 1;
> desc->type |= info->contents << 2;
>
> which always leaves bit #0 of ->type clear. That's the A bit.
>
> Does the problem go away if we just add a
>
> desc->type |= 1;
>
> to the end there?
I can easily imagine that breaking WINE or DOSEMU because it'll affect
the LDT, too.
How about this:
https://git.kernel.org/pub/scm/linux/kernel/git/luto/linux.git/commit/?h=x86/fixes&id=df8110544c6e899897e1b2ec3ab53d9e4ee40f65
I'll see why selftests didn't catch this, too.
Powered by blists - more mailing lists