Skip to content

Commit

Permalink
selftests/x86/ldt_gdt: Run most existing LDT test cases against the G…
Browse files Browse the repository at this point in the history
…DT as well

Now that the main test infrastructure supports the GDT, run tests
that will pass the kernel's GDT permission tests against the GDT.

Signed-off-by: Andy Lutomirski <luto@kernel.org>
Cc: Borislav Petkov <bpetkov@suse.de>
Cc: Linus Torvalds <torvalds@linux-foundation.org>
Cc: Peter Zijlstra <peterz@infradead.org>
Cc: Thomas Gleixner <tglx@linutronix.de>
Link: http://lkml.kernel.org/r/686a1eda63414da38fcecc2412db8dba1ae40581.1509794321.git.luto@kernel.org
Signed-off-by: Ingo Molnar <mingo@kernel.org>
  • Loading branch information
Andy Lutomirski authored and Ingo Molnar committed Nov 7, 2017
1 parent d744dca commit adedf28
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion tools/testing/selftests/x86/ldt_gdt.c
Original file line number Diff line number Diff line change
Expand Up @@ -189,7 +189,15 @@ static bool install_valid_mode(const struct user_desc *d, uint32_t ar,

static bool install_valid(const struct user_desc *desc, uint32_t ar)
{
return install_valid_mode(desc, ar, false, true);
bool ret = install_valid_mode(desc, ar, false, true);

if (desc->contents <= 1 && desc->seg_32bit &&
!desc->seg_not_present) {
/* Should work in the GDT, too. */
install_valid_mode(desc, ar, false, false);
}

return ret;
}

static void install_invalid(const struct user_desc *desc, bool oldmode)
Expand Down

0 comments on commit adedf28

Please sign in to comment.