Received: by 2002:a25:ab43:0:0:0:0:0 with SMTP id u61csp5962517ybi; Wed, 12 Jun 2019 11:27:58 -0700 (PDT) X-Google-Smtp-Source: APXvYqylle3NeRVamdb51YBMHsDm8dUXA6MVFgg7hORMd3FQYTMsyZRL3wCv9ZO/EFqjlftH31Ch X-Received: by 2002:a17:902:2862:: with SMTP id e89mr83693980plb.258.1560364078420; Wed, 12 Jun 2019 11:27:58 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1560364078; cv=none; d=google.com; s=arc-20160816; b=P9UGTkDbqiFWEV+ON5h4ktw7QgYyYdmy5z0mCwA7Vm8eh57er9kN39w/N7JjTS6y6r rM8AzDiwadgrJFnHxxeXx/d4UO2zUYNzFAT2h4cnRdpwCV+aEbSqMjfwVJ0sgRAM3UlE VB/eOIPyMuIgR1gfsbPjw80JA7EsCnGbnK6q5dthBzSZ/H8ONS23Xdx2WhHqLHPf2jTC xwgql60PLbfTxMrVZxiUHIVuU73L5zu2dZeOlYbBrO0dqOvf/mlDYzU/CEa+jeFxrCGz WwpkDxpXt2a1KKY6jX6OyzQvU7BNITuhOiUxDCHxnoOqaeLxLXFdRRlvEkHnuHJnZomB n29g== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:user-agent:in-reply-to :content-disposition:mime-version:references:message-id:subject:cc :to:from:date; bh=8+ft67gLSM1rrDdnljBHIb0dGMGD+iFhA8XvcJRi9W8=; b=T811J0N68jsKLzeevMxfFnwU3ZT6svOSD2wdl/refCE/M8ULW9CDJlgErDOyyIaMko jxZsp8gAYe9Ayz2YtsudUygJLncEfcFWNHa7b2Ocm9j6F9O2R1SOvCFO+lJR4P67RaCY m+QS402dGCMSZztacbnWVW2rhrx2ANXODnGzy1vXQ2Vh3gMwS6tR+ljjFM1x/PXb+Ert V//dl6+HQDVG4nTMjdzxdhGnky+Gcc/XtLuwzXa13ybOdA5LmYUWQDsdaaUcSvmfnGbi E3v0LtEl9BIUrqvDwTopyHLZVbYwZAhvwesLVrKy4e89ES5kL6WiC/qPw1aUS6ysW14X bGlw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id o5si479832pfg.106.2019.06.12.11.27.43; Wed, 12 Jun 2019 11:27:58 -0700 (PDT) Received-SPF: pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) client-ip=209.132.180.67; Authentication-Results: mx.google.com; spf=pass (google.com: best guess record for domain of linux-kernel-owner@vger.kernel.org designates 209.132.180.67 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=intel.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728028AbfFLSZx (ORCPT + 99 others); Wed, 12 Jun 2019 14:25:53 -0400 Received: from mga14.intel.com ([192.55.52.115]:20006 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1727843AbfFLSZv (ORCPT ); Wed, 12 Jun 2019 14:25:51 -0400 X-Amp-Result: UNKNOWN X-Amp-Original-Verdict: FILE UNKNOWN X-Amp-File-Uploaded: False Received: from fmsmga007.fm.intel.com ([10.253.24.52]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 12 Jun 2019 11:25:50 -0700 X-ExtLoop1: 1 Received: from sjchrist-coffee.jf.intel.com (HELO linux.intel.com) ([10.54.74.36]) by fmsmga007.fm.intel.com with ESMTP; 12 Jun 2019 11:25:50 -0700 Date: Wed, 12 Jun 2019 11:25:50 -0700 From: Sean Christopherson To: Marius Hillenbrand Cc: kvm@vger.kernel.org, linux-kernel@vger.kernel.org, kernel-hardening@lists.openwall.com, linux-mm@kvack.org, Alexander Graf , David Woodhouse Subject: Re: [RFC 00/10] Process-local memory allocations for hiding KVM secrets Message-ID: <20190612182550.GI20308@linux.intel.com> References: <20190612170834.14855-1-mhillenb@amazon.de> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20190612170834.14855-1-mhillenb@amazon.de> User-Agent: Mutt/1.5.24 (2015-08-30) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Jun 12, 2019 at 07:08:24PM +0200, Marius Hillenbrand wrote: > The Linux kernel has a global address space that is the same for any > kernel code. This address space becomes a liability in a world with > processor information leak vulnerabilities, such as L1TF. With the right > cache load gadget, an attacker-controlled hyperthread pair can leak > arbitrary data via L1TF. Disabling hyperthreading is one recommended > mitigation, but it comes with a large performance hit for a wide range > of workloads. > > An alternative mitigation is to not make certain data in the kernel > globally visible, but only when the kernel executes in the context of > the process where this data belongs to. > > This patch series proposes to introduce a region for what we call > process-local memory into the kernel's virtual address space. Page > tables and mappings in that region will be exclusive to one address > space, instead of implicitly shared between all kernel address spaces. > Any data placed in that region will be out of reach of cache load > gadgets that execute in different address spaces. To implement > process-local memory, we introduce a new interface kmalloc_proclocal() / > kfree_proclocal() that allocates and maps pages exclusively into the > current kernel address space. As a first use case, we move architectural > state of guest CPUs in KVM out of reach of other kernel address spaces. Can you briefly describe what types of attacks this is intended to mitigate? E.g. guest-guest, userspace-guest, etc... I don't want to make comments based on my potentially bad assumptions. > The patch set is a prototype for x86-64 that we have developed on top of > kernel 4.20.17 (with cherry-picked commit d253ca0c3865 "x86/mm/cpa: Add > set_direct_map_*() functions"). I am aware that the integration with KVM > will see some changes while rebasing to 5.x. Patches 7 and 8, in Ha, "some" :-) > particular, help make patch 9 more readable, but will be dropped in > rebasing. We have tested the code on both Intel and AMDs, launching VMs > in a loop. So far, we have not done in-depth performance evaluation. > Impact on starting VMs was within measurement noise.