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


Groups > linux.kernel > #1519554

Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention

From Ricardo Neri <ricardo.neri-calderon@linux.intel.com>
Newsgroups linux.kernel
Subject Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention
Date 2016-11-11 05:20 +0100
Message-ID <sCbtL-7PU-7@gated-at.bofh.it> (permalink)
References (2 earlier) <sBgFb-2G7-13@gated-at.bofh.it> <sBsQ1-2tX-11@gated-at.bofh.it> <sBzot-6GJ-15@gated-at.bofh.it> <sBRlo-1Xo-11@gated-at.bofh.it> <sBTnb-3hK-5@gated-at.bofh.it>
Organization linux.* mail to news gateway

Show all headers | View raw


On Thu, 2016-11-10 at 11:52 +0300, Stas Sergeev wrote:
> Hi!
> 
> I don't know the context of that discussion, so I'll only
> comment on the dosemu part.

I'm sorry! I will cc you and the linux-msdos list in my v2.
> 
> 10.11.2016 09:46, Ricardo Neri пишет:
> > I took a closer look at the dosemu code. It appears that it does not
> > purposely utilize SGDT to obtain the descriptor table while in vm86. It
> > does use SGDT (in protected mode) to emulate certain functionality such
> > as the Virtual xxx Driver. In such a case, UMIP needs to be disabled.
> > However, this code seems to be disabled [1].
> Indeed.
> The code you've found, was copied from wine, because
> dosemu supports windows-3.1. But sgdt is in win32s part
> that is disabled in dosemu. It is however enabled in wine, or
> at least it was when I ported the VxD code from there. So you
> may want to ask wine devs if they still use sgdt and vm86.
> In dosemu, if we ever enable win32s support, we won't rely
> on sgdt. In fact, when some prot mode program under dosemu
> uses GDT selectors, in a fault handler we replace them with
> LDT selectors.

Actually, the SLDT instruction is also impacted by this feature. This
feature, will cause a GP fault if the instructions SGDT, SLDT, SIDT,
SMSW or STR are executed with CPL > 0. Would this be a problem for
dosemu? The proposal now is to trap this GPU fault and give fake value
for these tables.
> 
> >   dosemu includes an i386
> > emulator that in some cases uses the actual instructions of the host
> > system.
> In dosemu2 code, the places you've found, now contain this:
> error("SGDT not implemented\n");
> If we ever support SGDT, we'll use some emulation/fake values.
> 
> So overall, dosemu is not going to willingly use sgdt in any
> near future. But the programs running under vm86 or in prot mode
> may do so. This is very uncommon though, especially under dosemu,
> because it supports only a "polite" programs - those that work
> under win95's dos prompt. No one would get sufficiently hurt if
> sgdt under vm86 will somehow change from its current behaviour.

This is good news. This means that we could go ahead and give a fake
pointer to the GDT and the other impacted tables?
> 
> You can ask wine people for their sgdt use in win32s subsystem.

Will do.

Thanks and BR,
Ricardo

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


Thread

[PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 3/4] x86: Enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 4/4] selftests/x86: Add tests for User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
  [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-08 07:20 +0100
    Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-08 17:10 +0100
      Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Peter Zijlstra <peterz@infradead.org> - 2016-11-08 18:10 +0100
        Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode  Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:30 +0100
  Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Peter Zijlstra <peterz@infradead.org> - 2016-11-08 14:20 +0100
    Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-08 16:40 +0100
      Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Thomas Gleixner <tglx@linutronix.de> - 2016-11-08 18:00 +0100
        Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:30 +0100
      Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-09 05:40 +0100
        Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Andy Lutomirski <luto@amacapital.net> - 2016-11-09 12:40 +0100
          Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-10 07:50 +0100
            Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Stas Sergeev <stsp@list.ru> - 2016-11-10 10:00 +0100
              Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-11 05:20 +0100
                Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Stas Sergeev <stsp@list.ru> - 2016-11-11 22:00 +0100
                Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Ricardo Neri <ricardo.neri-calderon@linux.intel.com> - 2016-11-12 02:30 +0100
            Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention One Thousand Gnomes <gnomes@lxorguk.ukuu.org.uk> - 2016-11-14 12:10 +0100
              Re: [PATCH 0/4] x86: enable User-Mode Instruction Prevention Harald Arnesen <skogtun.linux@gmail.com> - 2016-11-14 19:40 +0100

csiph-web