linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH] selftests/x86: Disable ldt_gdt_64 for now
@ 2016-01-06 19:51 Andy Lutomirski
  2016-01-07 20:49 ` Shuah Khan
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2016-01-06 19:51 UTC (permalink / raw)
  To: x86; +Cc: Borislav Petkov, Shuah Khan, linux-kernel, Andy Lutomirski

ldt_gdt.c relies on cross-cpu invalidation of SS to do one of its
tests.  On 32-bit builds, this works fine, but on 64-bit builds, it
only works if the kernel has proper SS sigcontext handling for
64-bit user programs.

Since the SS fixes are currently reverted, restrict the test case to
32 bits for now.

In principle, I could change the test to use a different segment
register, but it would be messy: CS can't point to the LDT for
64-bit code, and the other registers don't result in immediate
faults because they aren't reloaded on kernel -> user transitions.

When we fix sigcontext (in 4.6?), we can revert this.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
---
 tools/testing/selftests/x86/Makefile | 5 +++--
 1 file changed, 3 insertions(+), 2 deletions(-)

diff --git a/tools/testing/selftests/x86/Makefile b/tools/testing/selftests/x86/Makefile
index 3d1a8ef500a0..c0c15ff179b7 100644
--- a/tools/testing/selftests/x86/Makefile
+++ b/tools/testing/selftests/x86/Makefile
@@ -4,10 +4,11 @@ include ../lib.mk
 
 .PHONY: all all_32 all_64 warn_32bit_failure clean
 
-TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs ldt_gdt syscall_nt ptrace_syscall
+TARGETS_C_BOTHBITS := single_step_syscall sysret_ss_attrs syscall_nt ptrace_syscall
 TARGETS_C_32BIT_ONLY := entry_from_vm86 syscall_arg_fault sigreturn test_syscall_vdso unwind_vdso \
 			test_FCMOV test_FCOMI test_FISTTP \
-			vdso_restorer
+			vdso_restorer \
+			ldt_gdt
 
 TARGETS_C_32BIT_ALL := $(TARGETS_C_BOTHBITS) $(TARGETS_C_32BIT_ONLY)
 BINARIES_32 := $(TARGETS_C_32BIT_ALL:%=%_32)
-- 
2.5.0


^ permalink raw reply related	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests/x86: Disable ldt_gdt_64 for now
  2016-01-06 19:51 [PATCH] selftests/x86: Disable ldt_gdt_64 for now Andy Lutomirski
@ 2016-01-07 20:49 ` Shuah Khan
  2016-01-11 10:59   ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Shuah Khan @ 2016-01-07 20:49 UTC (permalink / raw)
  To: Andy Lutomirski, x86; +Cc: Borislav Petkov, linux-kernel, Shuah Khan

On 01/06/2016 12:51 PM, Andy Lutomirski wrote:
> ldt_gdt.c relies on cross-cpu invalidation of SS to do one of its
> tests.  On 32-bit builds, this works fine, but on 64-bit builds, it
> only works if the kernel has proper SS sigcontext handling for
> 64-bit user programs.
> 
> Since the SS fixes are currently reverted, restrict the test case to
> 32 bits for now.
> 
> In principle, I could change the test to use a different segment
> register, but it would be messy: CS can't point to the LDT for
> 64-bit code, and the other registers don't result in immediate
> faults because they aren't reloaded on kernel -> user transitions.
> 
> When we fix sigcontext (in 4.6?), we can revert this.
> 
> Signed-off-by: Andy Lutomirski <luto@kernel.org>
> --

Andy,

This patch didn't apply to linux-kselftest next.
It probably has to go through x86.

thanks,
-- Shuah

-- 
Shuah Khan
Sr. Linux Kernel Developer
Open Source Innovation Group
Samsung Research America (Silicon Valley)
shuahkh@osg.samsung.com | (970) 217-8978

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests/x86: Disable ldt_gdt_64 for now
  2016-01-07 20:49 ` Shuah Khan
@ 2016-01-11 10:59   ` Ingo Molnar
  2016-01-12  1:25     ` Andy Lutomirski
  0 siblings, 1 reply; 5+ messages in thread
From: Ingo Molnar @ 2016-01-11 10:59 UTC (permalink / raw)
  To: Shuah Khan; +Cc: Andy Lutomirski, x86, Borislav Petkov, linux-kernel


* Shuah Khan <shuahkh@osg.samsung.com> wrote:

> On 01/06/2016 12:51 PM, Andy Lutomirski wrote:
> > ldt_gdt.c relies on cross-cpu invalidation of SS to do one of its
> > tests.  On 32-bit builds, this works fine, but on 64-bit builds, it
> > only works if the kernel has proper SS sigcontext handling for
> > 64-bit user programs.
> > 
> > Since the SS fixes are currently reverted, restrict the test case to
> > 32 bits for now.
> > 
> > In principle, I could change the test to use a different segment
> > register, but it would be messy: CS can't point to the LDT for
> > 64-bit code, and the other registers don't result in immediate
> > faults because they aren't reloaded on kernel -> user transitions.
> > 
> > When we fix sigcontext (in 4.6?), we can revert this.
> > 
> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> > --
> 
> Andy,
> 
> This patch didn't apply to linux-kselftest next.
> It probably has to go through x86.

It doesn't apply to -tip either. Andy, which tree is this against?

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests/x86: Disable ldt_gdt_64 for now
  2016-01-11 10:59   ` Ingo Molnar
@ 2016-01-12  1:25     ` Andy Lutomirski
  2016-01-12 10:45       ` Ingo Molnar
  0 siblings, 1 reply; 5+ messages in thread
From: Andy Lutomirski @ 2016-01-12  1:25 UTC (permalink / raw)
  To: Ingo Molnar
  Cc: Shuah Khan, Andy Lutomirski, X86 ML, Borislav Petkov, linux-kernel

On Mon, Jan 11, 2016 at 2:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
>
> * Shuah Khan <shuahkh@osg.samsung.com> wrote:
>
>> On 01/06/2016 12:51 PM, Andy Lutomirski wrote:
>> > ldt_gdt.c relies on cross-cpu invalidation of SS to do one of its
>> > tests.  On 32-bit builds, this works fine, but on 64-bit builds, it
>> > only works if the kernel has proper SS sigcontext handling for
>> > 64-bit user programs.
>> >
>> > Since the SS fixes are currently reverted, restrict the test case to
>> > 32 bits for now.
>> >
>> > In principle, I could change the test to use a different segment
>> > register, but it would be messy: CS can't point to the LDT for
>> > 64-bit code, and the other registers don't result in immediate
>> > faults because they aren't reloaded on kernel -> user transitions.
>> >
>> > When we fix sigcontext (in 4.6?), we can revert this.
>> >
>> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
>> > --
>>
>> Andy,
>>
>> This patch didn't apply to linux-kselftest next.
>> It probably has to go through x86.
>
> It doesn't apply to -tip either. Andy, which tree is this against?

Oops, it applies on top of a new self-test that I forgot to send.  I
send a v2 that should be better.  I'll send the new selftest out as
well once -tip catches up with all the vdso patches.

--Andy

^ permalink raw reply	[flat|nested] 5+ messages in thread

* Re: [PATCH] selftests/x86: Disable ldt_gdt_64 for now
  2016-01-12  1:25     ` Andy Lutomirski
@ 2016-01-12 10:45       ` Ingo Molnar
  0 siblings, 0 replies; 5+ messages in thread
From: Ingo Molnar @ 2016-01-12 10:45 UTC (permalink / raw)
  To: Andy Lutomirski
  Cc: Shuah Khan, Andy Lutomirski, X86 ML, Borislav Petkov, linux-kernel


* Andy Lutomirski <luto@amacapital.net> wrote:

> On Mon, Jan 11, 2016 at 2:59 AM, Ingo Molnar <mingo@kernel.org> wrote:
> >
> > * Shuah Khan <shuahkh@osg.samsung.com> wrote:
> >
> >> On 01/06/2016 12:51 PM, Andy Lutomirski wrote:
> >> > ldt_gdt.c relies on cross-cpu invalidation of SS to do one of its
> >> > tests.  On 32-bit builds, this works fine, but on 64-bit builds, it
> >> > only works if the kernel has proper SS sigcontext handling for
> >> > 64-bit user programs.
> >> >
> >> > Since the SS fixes are currently reverted, restrict the test case to
> >> > 32 bits for now.
> >> >
> >> > In principle, I could change the test to use a different segment
> >> > register, but it would be messy: CS can't point to the LDT for
> >> > 64-bit code, and the other registers don't result in immediate
> >> > faults because they aren't reloaded on kernel -> user transitions.
> >> >
> >> > When we fix sigcontext (in 4.6?), we can revert this.
> >> >
> >> > Signed-off-by: Andy Lutomirski <luto@kernel.org>
> >> > --
> >>
> >> Andy,
> >>
> >> This patch didn't apply to linux-kselftest next.
> >> It probably has to go through x86.
> >
> > It doesn't apply to -tip either. Andy, which tree is this against?
> 
> Oops, it applies on top of a new self-test that I forgot to send.  I
> send a v2 that should be better.  I'll send the new selftest out as
> well once -tip catches up with all the vdso patches.

Ok, sounds great!

Thanks,

	Ingo

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2016-01-12 10:45 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2016-01-06 19:51 [PATCH] selftests/x86: Disable ldt_gdt_64 for now Andy Lutomirski
2016-01-07 20:49 ` Shuah Khan
2016-01-11 10:59   ` Ingo Molnar
2016-01-12  1:25     ` Andy Lutomirski
2016-01-12 10:45       ` Ingo Molnar

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).