Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.kernel > #1605794

Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel

From Andy Lutomirski <luto@amacapital.net>
Newsgroups linux.kernel
Subject Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel
Date 2017-03-21 17:40 +0100
Message-ID <tnuZc-5Ru-47@gated-at.bofh.it> (permalink)
References (2 earlier) <tnlMd-82W-15@gated-at.bofh.it> <tnnkZ-EB-1@gated-at.bofh.it> <tnroB-3oD-1@gated-at.bofh.it> <tnuZd-5Ru-49@gated-at.bofh.it> <tnuZd-5Ru-51@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Tue, Mar 21, 2017 at 8:59 AM, Dmitry Safonov <dsafonov@virtuozzo.com> wrote:
> On 03/21/2017 03:50 PM, Dmitry Safonov wrote:
>>
>> On 03/21/2017 03:49 PM, Thomas Gleixner wrote:
>>>
>>> On Tue, 21 Mar 2017, Adam Borowski wrote:
>>>>
>>>> On Tue, Mar 21, 2017 at 07:45:39AM +0100, Ingo Molnar wrote:
>>>>>
>>>>> * Andrei Vagin <avagin@gmail.com> wrote:
>>>>>
>>>>>> # first bad commit: [45fc8757d1d2128e342b4e7ef39adedf7752faac] x86:
>>>>>> Make the GDT remapping read-only on 64-bit
>>>>>
>>>>>
>>>>> Just wondering, does the following commit fix it:
>>>>>
>>>>>   5b781c7e317f x86/tls: Forcibly set the accessed bit in TLS segments
>>>>
>>>>
>>>> It does fix i386 but not x32.
>>>>
>>>> By "x32" I mean CONFIG_X86_X32, by "i386" CONFIG_IA32_EMULATION,
>>>> contrary to
>>>> Andrei's first report.  The naming of the new ABI wasn't too
>>>> fortunate...
>>>
>>>
>>> The X32 issue is unrelated to the GDT mapping.
>>>
>>> What happens is that the mmap rework from Dmitry switched X32 to use
>>> 64bit
>>> mappings, which is wrong. X32 has 64bit instructions and syscalls and
>>> 32bit
>>> address space.
>>
>>
>> Hmm, in_compat_syscall() checks x32 syscall bit.
>
>
> Which is not set during exec() for x32. So in_compat_syscall() doesn't
> work there.
> I've tested this patch on x32-debian port:
> https://lkml.org/lkml/2017/3/21/489

Seems generally reasonable to me.  It aligns x32 with existing
practice for i386, I think.

>
> Though I'm not very happy with the resulting patch :(
> Maybe one could suggest a better idea..

IMO it would be nice if execve() didn't call into any function that
checked in_compat_syscall(), etc, but maybe that's a pipe dream.

Back to linux.kernel | Previous | NextPrevious in thread | Find similar | Unroll thread


Thread

linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Andrei Vagin <avagin@gmail.com> - 2017-03-21 01:00 +0100
  Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Adam Borowski <kilobyte@angband.pl> - 2017-03-21 04:00 +0100
  Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Andrei Vagin <avagin@gmail.com> - 2017-03-21 06:20 +0100
    Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Ingo Molnar <mingo@kernel.org> - 2017-03-21 07:50 +0100
      Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Adam Borowski <kilobyte@angband.pl> - 2017-03-21 09:30 +0100
        Re: linux-next: x86: Unalbe to run x32 processes on the x86_64  kernel Thomas Gleixner <tglx@linutronix.de> - 2017-03-21 13:50 +0100
          Re: linux-next: x86: Unalbe to run x32 processes on the x86_64 kernel Andy Lutomirski <luto@amacapital.net> - 2017-03-21 17:40 +0100

csiph-web