Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1754760AbbGUT7i (ORCPT ); Tue, 21 Jul 2015 15:59:38 -0400 Received: from mail.kernel.org ([198.145.29.136]:45878 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752077AbbGUT7g (ORCPT ); Tue, 21 Jul 2015 15:59:36 -0400 From: Andy Lutomirski To: Peter Zijlstra , Steven Rostedt Cc: "security@kernel.org" , X86 ML , Borislav Petkov , Sasha Levin , linux-kernel@vger.kernel.org, Konrad Rzeszutek Wilk , Boris Ostrovsky , Andy Lutomirski Subject: [PATCH v2 0/3] x86: modify_ldt improvement, test, and config option Date: Tue, 21 Jul 2015 12:59:28 -0700 Message-Id: X-Mailer: git-send-email 2.4.3 Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1785 Lines: 46 Here's v2. It fixes the "dazed and confused" issue, I hope. It's also probably a good general attack surface reduction, and it replaces some scary code with IMO less scary code. Also, servers and embedded systems should probably turn off modify_ldt. This makes that possible. Xen people, can you take a look at this? I think that, with this change, write_ldt_entry is unnecessary. Changes from v1: - The config option is new. - The test case is new. - Fixed a missing allocation failure check. - Fixed a use-after-free on fork(). Andy Lutomirski (3): x86/ldt: Make modify_ldt synchronous x86/ldt: Make modify_ldt optional selftests/x86, x86/ldt: Add a selftest for modify_ldt arch/x86/Kconfig | 17 ++ arch/x86/include/asm/desc.h | 15 -- arch/x86/include/asm/mmu.h | 5 +- arch/x86/include/asm/mmu_context.h | 63 ++++- arch/x86/kernel/Makefile | 3 +- arch/x86/kernel/cpu/common.c | 4 +- arch/x86/kernel/cpu/perf_event.c | 16 +- arch/x86/kernel/ldt.c | 247 +++++++++-------- arch/x86/kernel/process_64.c | 6 +- arch/x86/kernel/step.c | 8 +- arch/x86/power/cpu.c | 3 +- kernel/sys_ni.c | 1 + tools/testing/selftests/x86/Makefile | 2 +- tools/testing/selftests/x86/ldt_gdt.c | 492 ++++++++++++++++++++++++++++++++++ 14 files changed, 730 insertions(+), 152 deletions(-) create mode 100644 tools/testing/selftests/x86/ldt_gdt.c -- 2.4.3 -- To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/