Skip to content

Commit adedf28

Browse files
amlutoIngo Molnar
authored andcommitted
selftests/x86/ldt_gdt: Run most existing LDT test cases against the GDT 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 <[email protected]> Cc: Borislav Petkov <[email protected]> Cc: Linus Torvalds <[email protected]> Cc: Peter Zijlstra <[email protected]> Cc: Thomas Gleixner <[email protected]> Link: http://lkml.kernel.org/r/686a1eda63414da38fcecc2412db8dba1ae40581.1509794321.git.luto@kernel.org Signed-off-by: Ingo Molnar <[email protected]>
1 parent d744dca commit adedf28

File tree

1 file changed

+9
-1
lines changed

1 file changed

+9
-1
lines changed

tools/testing/selftests/x86/ldt_gdt.c

Lines changed: 9 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,15 @@ static bool install_valid_mode(const struct user_desc *d, uint32_t ar,
189189

190190
static bool install_valid(const struct user_desc *desc, uint32_t ar)
191191
{
192-
return install_valid_mode(desc, ar, false, true);
192+
bool ret = install_valid_mode(desc, ar, false, true);
193+
194+
if (desc->contents <= 1 && desc->seg_32bit &&
195+
!desc->seg_not_present) {
196+
/* Should work in the GDT, too. */
197+
install_valid_mode(desc, ar, false, false);
198+
}
199+
200+
return ret;
193201
}
194202

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

0 commit comments

Comments
 (0)