From patchwork Wed Oct 24 12:51:10 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Kirill A . Shutemov" X-Patchwork-Id: 10654619 Return-Path: Received: from mail.wl.linuxfoundation.org (pdx-wl-mail.web.codeaurora.org [172.30.200.125]) by pdx-korg-patchwork-2.web.codeaurora.org (Postfix) with ESMTP id AD26014BB for ; Wed, 24 Oct 2018 12:51:35 +0000 (UTC) Received: from mail.wl.linuxfoundation.org (localhost [127.0.0.1]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 9B1262A7D3 for ; Wed, 24 Oct 2018 12:51:35 +0000 (UTC) Received: by mail.wl.linuxfoundation.org (Postfix, from userid 486) id 970012A792; Wed, 24 Oct 2018 12:51:35 +0000 (UTC) X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on pdx-wl-mail.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.9 required=2.0 tests=BAYES_00,MAILING_LIST_MULTI, RCVD_IN_DNSWL_NONE autolearn=ham version=3.3.1 Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.wl.linuxfoundation.org (Postfix) with ESMTP id 477AD2A732 for ; Wed, 24 Oct 2018 12:51:34 +0000 (UTC) Received: by kanga.kvack.org (Postfix) id 3C68D6B0287; Wed, 24 Oct 2018 08:51:33 -0400 (EDT) Delivered-To: linux-mm-outgoing@kvack.org Received: by kanga.kvack.org (Postfix, from userid 40) id 3735C6B0288; Wed, 24 Oct 2018 08:51:33 -0400 (EDT) X-Original-To: int-list-linux-mm@kvack.org X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 24F796B0289; Wed, 24 Oct 2018 08:51:33 -0400 (EDT) X-Original-To: linux-mm@kvack.org X-Delivered-To: linux-mm@kvack.org Received: from mail-pg1-f200.google.com (mail-pg1-f200.google.com [209.85.215.200]) by kanga.kvack.org (Postfix) with ESMTP id DAA9F6B0287 for ; Wed, 24 Oct 2018 08:51:32 -0400 (EDT) Received: by mail-pg1-f200.google.com with SMTP id e6-v6so2609569pge.5 for ; Wed, 24 Oct 2018 05:51:32 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-original-authentication-results:x-gm-message-state:from:to:cc :subject:date:message-id:mime-version:content-transfer-encoding; bh=aTg4ARfg6Oy4vBQBAVvHC7aPlGVWNloE+MJlRFivPmY=; b=agchQQ4F41undamjt9cZ9FPfdlbf9XNsVy83BrlFO8Wn1lWToPu8W5FYoQRJ9gHhGr YabTyhdHrkAPDCnFck260fJXqHXRNWi9vQPiXJXXLam9Gmb3FUdqtzU1YvtoHfWGnJKu qxoqTmYWFKqDer+bxQMt3d8SmVlZr6HyivyZHqz9rJBYQmvhWugZSNWvPF35TKdMqlTy i8b6WTNGxs5qJWnO4Ye3ym2d2PPMM2ZkGanB5xR5UOjTYnrMtbR1QPcZ7bvzvH18Eyvh U19YDJLY+2l+R9GTENyTE2R3IFOcFpn/JntpFk90u9ohpB9+qN0yw7G4XpoZuYU8rluV MmiQ== X-Original-Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Gm-Message-State: AGRZ1gKFkzeAMSvtrx1rVfs01YHNMqvNwhWArWlJ/vJyr1uMOlMR3zuL Z1RQ+d+tdvEyIC7VOpdwlXrvHqxaAkYYQbCTtj/sdDcW3pdnQttngEvHe+jPHymPq9fVfhRTqZ1 V1+P4T061Gdxq6WkizyuvWp3YiTyl/nFUkzHQ1JGKLvugP7OEtOmROCWdl5KxAvobvA== X-Received: by 2002:a62:48ce:: with SMTP id q75-v6mr2612905pfi.22.1540385492550; Wed, 24 Oct 2018 05:51:32 -0700 (PDT) X-Google-Smtp-Source: AJdET5eVwJhyvESuktaRXNjMrJU73MiyiQwBL0KhFS1oNh/tlCwrUfmpQDcZOgcc2HiCk1G/FHbq X-Received: by 2002:a62:48ce:: with SMTP id q75-v6mr2612863pfi.22.1540385491751; Wed, 24 Oct 2018 05:51:31 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1540385491; cv=none; d=google.com; s=arc-20160816; b=iY4Fun8S6AkXE3p2mMFtv6l05KBwW3cecjfa4ADOMuIPgneGBYRkfcIz4dFCCnlZBR q4uSWjY7ogtlwluRiPsvoFjqpoup51YqJQTbMu/aIa4I5PYCQfTYt98+pgkMdggRwjXE INWadtYu+vXeIZa/DFFXL1pZ5a/9sR+SpFE6C9sTnU/jBa8VzJ85eY2g9q5GrIW9u3pe BLje+DDSXm+0+WatNIUquv+/z1JLdFXEWv0S12IeOLF2wj9TFdGl0DksJwr+82I7KKjW tBi0dhfSZFIskGAYEsGvaLjb8/al8nB2SAHpbTCNEj9a55CmdcOz35GEIWEgb+evdRe1 x7VA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=content-transfer-encoding:mime-version:message-id:date:subject:cc :to:from; bh=aTg4ARfg6Oy4vBQBAVvHC7aPlGVWNloE+MJlRFivPmY=; b=QtxDP/IPT8MRpPs3dX8zdJoJgSq5zo5pVS7d0eYJXxFsDPSqco45ycZBRtdQfLkRmg 9zrBYNgTa4/8pWNKnn/pNTe5NELk4iRmeeDOWxcjUx3uRx1OoQUAokjEF4YKcQtNDaCB R7pTQ6UMoQYyy6MmDKSMLQC16hqqhcmw9KXlBHann7RHUXSuP/quI+Ttn2EExInwsRR6 fOpyeaEYIBs+qC5HVxu4Vi8N2kIUOANNCZ1VgDJtSXBN9V8q4M73obY+4rXqGH/10zqI jbn2cvbsvkmQmIt7v/5r380TjxR2nklBJjcDvn9lMwr+iotz31KIDKn0xz5pdG2AomyZ d6JA== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: from mga03.intel.com (mga03.intel.com. [134.134.136.65]) by mx.google.com with ESMTPS id x186-v6si4812465pfx.19.2018.10.24.05.51.31 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 24 Oct 2018 05:51:31 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.65 as permitted sender) client-ip=134.134.136.65; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of kirill.shutemov@linux.intel.com designates 134.134.136.65 as permitted sender) smtp.mailfrom=kirill.shutemov@linux.intel.com; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from orsmga001.jf.intel.com ([10.7.209.18]) by orsmga103.jf.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 24 Oct 2018 05:51:31 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,420,1534834800"; d="scan'208";a="102247618" Received: from black.fi.intel.com ([10.237.72.28]) by orsmga001.jf.intel.com with ESMTP; 24 Oct 2018 05:51:27 -0700 Received: by black.fi.intel.com (Postfix, from userid 1000) id A34D0BB; Wed, 24 Oct 2018 15:51:26 +0300 (EEST) From: "Kirill A. Shutemov" To: tglx@linutronix.de, mingo@redhat.com, bp@alien8.de, hpa@zytor.com, dave.hansen@linux.intel.com, luto@kernel.org, peterz@infradead.org Cc: boris.ostrovsky@oracle.com, jgross@suse.com, bhe@redhat.com, willy@infradead.org, x86@kernel.org, linux-mm@kvack.org, linux-kernel@vger.kernel.org, "Kirill A. Shutemov" Subject: [PATCHv2 0/2] Fix couple of issues with LDT remap for PTI Date: Wed, 24 Oct 2018 15:51:10 +0300 Message-Id: <20181024125112.55999-1-kirill.shutemov@linux.intel.com> X-Mailer: git-send-email 2.19.1 MIME-Version: 1.0 X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: X-Virus-Scanned: ClamAV using ClamSMTP The patchset fixes issues with LDT remap for PTI: - Layout collision due to KASLR with 5-level paging; - Information leak via Meltdown-like attack; Please review and consider applying. v2: - Rebase to the Linus' tree + fix conflict with new documentation of kernel memory layout + fix few mistakes in layout documentation - Fix typo in commit message Kirill A. Shutemov (2): x86/mm: Move LDT remap out of KASLR region on 5-level paging x86/ldt: Unmap PTEs for the slot before freeing LDT pages Documentation/x86/x86_64/mm.txt | 34 +++++++------- arch/x86/include/asm/page_64_types.h | 12 ++--- arch/x86/include/asm/pgtable_64_types.h | 4 +- arch/x86/kernel/ldt.c | 59 ++++++++++++++++--------- arch/x86/xen/mmu_pv.c | 6 +-- 5 files changed, 67 insertions(+), 48 deletions(-)