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

2016-11-11 Thread Ricardo Neri
On Fri, 2016-11-11 at 23:51 +0300, Stas Sergeev wrote: > 11.11.2016 07:14, Ricardo Neri пишет: > >> 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 th

Re: [PATCH 1/4] x86/cpufeature: Add User-Mode Instruction Prevention definitions

2016-11-11 Thread Ricardo Neri
On Fri, 2016-11-11 at 11:22 +0100, Borislav Petkov wrote: > On Thu, Nov 10, 2016 at 08:08:07PM -0800, Ricardo Neri wrote: > > UMIP is enabled by setting a bit in CR4. If that bit is not supposed > > to be set, that could cause a #GP fault. > > Yeah, you do check CPUID first,

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

2016-11-10 Thread Ricardo Neri
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 пишет: >

Re: [PATCH 1/4] x86/cpufeature: Add User-Mode Instruction Prevention definitions

2016-11-10 Thread Ricardo Neri
On Thu, 2016-11-10 at 09:58 +0100, Borislav Petkov wrote: > On Wed, Nov 09, 2016 at 07:24:43PM -0800, Ricardo Neri wrote: > > I intended this feature to be configurable at build time in case someone > > wants to build a kernel without it; similar to other features such as > &

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

2016-11-09 Thread Ricardo Neri
On Wed, 2016-11-09 at 03:05 -0800, Andy Lutomirski wrote: > On Tue, Nov 8, 2016 at 8:31 PM, Ricardo Neri > wrote: > > On Tue, 2016-11-08 at 07:34 -0800, Andy Lutomirski wrote: > >> > Would it not be better to emulate these instructions for them? What > >> way

Re: [PATCH 1/4] x86/cpufeature: Add User-Mode Instruction Prevention definitions

2016-11-09 Thread Ricardo Neri
On Wed, 2016-11-09 at 03:02 -0800, Andy Lutomirski wrote: > On Tue, Nov 8, 2016 at 8:25 PM, Ricardo Neri > wrote: > > On Tue, 2016-11-08 at 07:32 -0800, Andy Lutomirski wrote: > >> > diff --git a/arch/x86/include/asm/disabled-features.h > >> b/arch/x86/include/asm

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

2016-11-08 Thread Ricardo Neri
On Tue, 2016-11-08 at 07:34 -0800, Andy Lutomirski wrote: > > Would it not be better to emulate these instructions for them? What > way > > we can verify they're not malicious. > > Forget malice -- if they are really needed for some silly vm86-using > program, let's trap them and emulate them so t

Re: [PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention

2016-11-08 Thread Ricardo Neri
On Tue, 2016-11-08 at 18:00 +0100, Peter Zijlstra wrote: > > > + } > > > +#endif > > > + > > > > NAK. If this code is going to exist, it needs to be deeply buried > in > > some unlikely if statement that already exists. There's no good > > reason to penalize all context switches to support

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

2016-11-08 Thread Ricardo Neri
On Tue, 2016-11-08 at 17:52 +0100, Thomas Gleixner wrote: > On Tue, 8 Nov 2016, Andy Lutomirski wrote: > > On Tue, Nov 8, 2016 at 5:16 AM, Peter Zijlstra wrote: > > > On Mon, Nov 07, 2016 at 10:12:09PM -0800, Ricardo Neri wrote: > > >> There is a caveat, however. C

Re: [PATCH 1/4] x86/cpufeature: Add User-Mode Instruction Prevention definitions

2016-11-08 Thread Ricardo Neri
On Tue, 2016-11-08 at 07:32 -0800, Andy Lutomirski wrote: > > diff --git a/arch/x86/include/asm/disabled-features.h > b/arch/x86/include/asm/disabled-features.h > > index 85599ad..4707445 100644 > > --- a/arch/x86/include/asm/disabled-features.h > > +++ b/arch/x86/include/asm/disabled-features.h >

[PATCH 3/4] x86: Enable User-Mode Instruction Prevention

2016-11-07 Thread Ricardo Neri
Corbet Cc: Michael S. Tsirkin Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Ravi V. Shankar Cc: Shuah Khan Cc: Vlastimil Babka Signed-off-by: Ricardo Neri --- Documentation/kernel-parameters.txt | 5 arch/x86/Kconfig| 10 arch/x86/kernel/cpu/common.c| 50

[PATCH 4/4] selftests/x86: Add tests for User-Mode Instruction Prevention

2016-11-07 Thread Ricardo Neri
: Paul Gortmaker Cc: Peter Zijlstra Cc: Ravi V. Shankar Cc: Shuah Khan Cc: Vlastimil Babka Signed-off-by: Ricardo Neri --- tools/testing/selftests/x86/entry_from_vm86.c | 10 +- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/tools/testing/selftests/x86/entry_from_vm86.c b

[PATCH 1/4] x86/cpufeature: Add User-Mode Instruction Prevention definitions

2016-11-07 Thread Ricardo Neri
lf Cc: Dave Hansen Cc: Fenghua Yu Cc: Huang Rui Cc: Jiri Slaby Cc: Jonathan Corbet Cc: Michael S. Tsirkin Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Ravi V. Shankar Cc: Shuah Khan Cc: Vlastimil Babka Signed-off-by: Ricardo Neri --- arch/x86/include/asm/cpufeatures.h | 1 + ar

[PATCH 2/4] x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention

2016-11-07 Thread Ricardo Neri
l S. Tsirkin Cc: Paul Gortmaker Cc: Peter Zijlstra Cc: Ravi V. Shankar Cc: Shuah Khan Cc: Vlastimil Babka Signed-off-by: Ricardo Neri --- arch/x86/include/asm/vm86.h | 3 +++ arch/x86/kernel/process.c | 10 ++ arch/x86/kernel/vm86_32.c | 20 3 files changed,

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

2016-11-07 Thread Ricardo Neri
Shuah Khan [1]. http://www.dosemu.org/ [2]. https://wiki.winehq.org/Main_Page Ricardo Neri (4): x86/cpufeature: Add User-Mode Instruction Prevention definitions x86: Prepare vm86 tasks to handle User-Mode Instruction Prevention x86: Enable User-Mode Instruction Prevention selftests/x86: Ad