Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit addressing encodings

2017-01-26 Thread Andy Lutomirski
On Wed, Jan 25, 2017 at 9:50 PM, Ricardo Neri <ricardo.neri-calde...@linux.intel.com> wrote: > On Wed, 2017-01-25 at 13:58 -0800, Andy Lutomirski wrote: >> On Wed, Jan 25, 2017 at 12:23 PM, Ricardo Neri >> <ricardo.neri-calde...@linux.intel.com> wrote: >> >

Re: [v3 PATCH 05/10] x86/insn-kernel: Add support to resolve 16-bit addressing encodings

2017-01-25 Thread Andy Lutomirski
On Wed, Jan 25, 2017 at 12:23 PM, Ricardo Neri wrote: > Tasks running in virtual-8086 mode will use 16-bit addressing form > encodings as described in the Intel 64 and IA-32 Architecture Software > Developer's Manual Volume 2A Section 2.1.5. 16-bit

Re: [PATCH v4 15/17] x86/traps: Fixup general protection faults caused by UMIP

2017-02-24 Thread Andy Lutomirski
On Thu, Feb 23, 2017 at 2:15 PM, Ricardo Neri wrote: > On Thu, 2017-02-23 at 10:27 +0100, Peter Zijlstra wrote: >> On Wed, Feb 22, 2017 at 10:37:04PM -0800, Ricardo Neri wrote: >> > @@ -492,6 +493,9 @@ do_general_protection(struct pt_regs *regs, long >> >

Re: [v2 5/7] x86: Add emulation code for UMIP instructions

2016-12-30 Thread Andy Lutomirski
On Thu, Dec 29, 2016 at 9:23 PM, Ricardo Neri <ricardo.neri-calde...@linux.intel.com> wrote: > On Tue, 2016-12-27 at 16:48 -0800, Andy Lutomirski wrote: >> >> >> > + if (nr_copied > 0) >> >> > + return -EFAULT;

Re: [v2 2/7] x86/mpx: Fail when implicit zero-displacement is used along with R/EBP

2016-12-23 Thread Andy Lutomirski
On Fri, Dec 23, 2016 at 5:37 PM, Ricardo Neri wrote: > Section 2.2.1.2 of the Intel 64 and IA-32 Architectures Software > Developer's Manual volume 2A states that when memory addressing with no > explicit displacement (i.e, mod part of ModR/M is 0), a SIB

Re: [v2 5/7] x86: Add emulation code for UMIP instructions

2016-12-23 Thread Andy Lutomirski
On Fri, Dec 23, 2016 at 5:37 PM, Ricardo Neri wrote: > The feature User-Mode Instruction Prevention present in recent Intel > processor prevents a group of instructions from being executed with > CPL > 0. Otherwise, a general protection fault is issued. > >

Re: [v2 6/7] x86/traps: Fixup general protection faults caused by UMIP

2016-12-23 Thread Andy Lutomirski
from user-mode context > (CPL > 0). If the fault was caused by any of the instructions protected > by UMIP, fixup_umip_exceptino will emulate dummy results for these > instructions. > > Cc: Andy Lutomirski <l...@kernel.org> > Cc: Andrew Morton <a...@linux-foundation.or

Re: [v2 1/7] x86/mpx: Do not use SIB index if index points to R/ESP

2016-12-23 Thread Andy Lutomirski
On Fri, Dec 23, 2016 at 5:37 PM, Ricardo Neri wrote: > Section 2.2.1.2 of the Intel 64 and IA-32 Architectures Software > Developer's Manual volume 2A states that when memory addressing is used > (i.e., mod part of ModR/M is not 3), a SIB byte is used and

Re: [v2 5/7] x86: Add emulation code for UMIP instructions

2016-12-27 Thread Andy Lutomirski
On Tue, Dec 27, 2016 at 4:39 PM, Ricardo Neri <ricardo.neri-calde...@linux.intel.com> wrote: > On Fri, 2016-12-23 at 18:11 -0800, Andy Lutomirski wrote: >> On Fri, Dec 23, 2016 at 5:37 PM, Ricardo Neri >> <ricardo.neri-calde...@linux.intel.com> wrote: >> &g

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-31 Thread Andy Lutomirski
On Fri, Mar 31, 2017 at 2:26 PM, Stas Sergeev wrote: > 31.03.2017 17:11, Alexandre Julliard пишет: >> >> In fact it would be nice to be able to make sidt/sgdt/etc. segfault >> too. I know a new syscall is a pain, > > Maybe arch_prctl() then? I still like my idea of a generic

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-09 Thread Andy Lutomirski
On Thu, Mar 9, 2017 at 2:10 PM, Stas Sergeev <s...@list.ru> wrote: > 09.03.2017 04:15, Ricardo Neri пишет: > >> On Wed, 2017-03-08 at 08:46 -0800, Andy Lutomirski wrote: >>> >>> On Wed, Mar 8, 2017 at 8:29 AM, Stas Sergeev <s...@list.ru> wrote: >>

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-09 Thread Andy Lutomirski
On Wed, Mar 8, 2017 at 5:11 PM, Ricardo Neri <ricardo.neri-calde...@linux.intel.com> wrote: > On Wed, 2017-03-08 at 19:53 +0300, Stas Sergeev wrote: >> 08.03.2017 19:46, Andy Lutomirski пишет: >> >> No no, since I meant prot mode, this is not what I need. >> >

Re: [v6 PATCH 19/21] x86/traps: Fixup general protection faults caused by UMIP

2017-03-08 Thread Andy Lutomirski
al is emitted. > > Please note that fixup_umip_exception also caters for the case when > the fault originated while running in virtual-8086 mode. Reviewed-by: Andy Lutomirski <l...@kernel.org> -- To unsubscribe from this list: send the line "unsubscribe linux-msdos" in the body o

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-08 Thread Andy Lutomirski
On Wed, Mar 8, 2017 at 6:08 AM, Stas Sergeev wrote: > 08.03.2017 03:32, Ricardo Neri пишет: >> >> These are the instructions covered by UMIP: >> * SGDT - Store Global Descriptor Table >> * SIDT - Store Interrupt Descriptor Table >> * SLDT - Store Local Descriptor Table >> * SMSW -

Re: [v6 PATCH 15/21] x86/mm: Relocate page fault error codes to traps.h

2017-03-08 Thread Andy Lutomirski
ation, the prefix X86_ is used to > make it consistent with the rest of the definitions in traps.h. Of course, > code using the enumeration had to be updated as well. No functional changes > were performed. > Reviewed-by: Andy Lutomirski <l...@kernel.org> -- To unsubscribe from t

Re: [v6 PATCH 21/21] selftests/x86: Add tests for User-Mode Instruction Prevention

2017-03-08 Thread Andy Lutomirski
On Tue, Mar 7, 2017 at 4:32 PM, Ricardo Neri wrote: > Certain user space programs that run on virtual-8086 mode may utilize > instructions protected by the User-Mode Instruction Prevention (UMIP) > security feature present in new Intel processors: SGDT, SIDT

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-08 Thread Andy Lutomirski
On Tue, Mar 7, 2017 at 4:32 PM, Ricardo Neri wrote: > This is v6 of this series. The five previous submissions can be found > here [1], here [2], here[3], here[4], and here[5]. This version addresses > the comments received in v4 plus improvements of the

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-08 Thread Andy Lutomirski
On Wed, Mar 8, 2017 at 8:29 AM, Stas Sergeev <s...@list.ru> wrote: > 08.03.2017 19:06, Andy Lutomirski пишет: >> >> On Wed, Mar 8, 2017 at 6:08 AM, Stas Sergeev <s...@list.ru> wrote: >>> >>> 08.03.2017 03:32, Ricardo Neri пишет: >>>> >

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-10 Thread Andy Lutomirski
On Fri, Mar 10, 2017 at 3:33 AM, Stas Sergeev <s...@list.ru> wrote: > 10.03.2017 05:39, Andy Lutomirski пишет: > >> On Thu, Mar 9, 2017 at 2:10 PM, Stas Sergeev <s...@list.ru> wrote: >>> >>> 09.03.2017 04:15, Ricardo Neri пишет: >>> >>&g

Re: [v6 PATCH 00/21] x86: Enable User-Mode Instruction Prevention

2017-03-10 Thread Andy Lutomirski
On Fri, Mar 10, 2017 at 2:30 AM, Stas Sergeev <s...@list.ru> wrote: > 10.03.2017 05:41, Andy Lutomirski пишет: > >> On Wed, Mar 8, 2017 at 5:11 PM, Ricardo Neri >> <ricardo.neri-calde...@linux.intel.com> wrote: >>> >>> On Wed, 2017-03-08 at 19:53 +0

Re: [v5 17/20] x86/umip: Force a page fault when unable to copy emulated result to user

2017-03-05 Thread Andy Lutomirski
On Fri, Mar 3, 2017 at 1:41 PM, Ricardo Neri wrote: > fixup_umip_exception will be called from do_general_protection. If the > former returns false, the latter will issue a SIGSEGV with SEND_SIG_PRIV. > However, when emulation is successful but the emulated