Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4387758yba; Wed, 17 Apr 2019 10:22:29 -0700 (PDT) X-Google-Smtp-Source: APXvYqyeAdc4e0eQPwUPzB4KOvZ1El9SG8l/d6kZcx6pfFdyFwDoeOItShxYwrwkY1OLLnZQHsEr X-Received: by 2002:a63:ff18:: with SMTP id k24mr82355412pgi.140.1555521749844; Wed, 17 Apr 2019 10:22:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555521749; cv=none; d=google.com; s=arc-20160816; b=cUp2NrK7sWqlo6fmxgOoDzrUGM4tsOkUhCO/hNMilN3EMKcaQKPbi+cUixwOOhVlNf rSB7TFRkSoRs3vlAmI1s558SLeIimPePbIdVBYIb30BWE0et3J0elm/g9uEYX0EtBLpP xx5tJ4O/X66PKC1ayrce28dH4TASfEc8Lyv3OsbPcTEz+mK81FcZ4yVQuwgh5yj/IocF u+5Ycj5CAkIWvGoVX1bP0RGM+B1Qqez3yN1B3VG3kT72D5ddvDwW5ZMFpDVf39PRL8cv iEidoTkAYtg/BUfF2wKIOBjL6ILMUxuAFUZw7nkBehiHjpRPOJbsmPtOhYqC2xkHhV+k xKFA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:to:references:message-id :content-transfer-encoding:cc:date:in-reply-to:from:subject :mime-version:dkim-signature; bh=V1yIYIvLzz+BOCdxdX2gjSKybWz8E9N/6tRrpN2enDY=; b=azJJ/IrVtCMEtoWnMMgSYbLEc7gOjKFcnKstI5pNGn5uAMNckEZsGK+sx7xZVgUU3v aE377piU4XP1BPKR1htXPltM77HIcw7lw0cj0jKTvoczTjfqKG6TquVnkFArF37CvrRQ SipzOEFmf+H86NSdDznYjgng5OlE/4YXFOWtJWPclyeB3Op821y24OIwymG2jhdfT9Tx aD2xH8WeYCCDIjOzwcIFW1gl5brLYsp6NCcHDvmkz6oqHBTZ1Ek6a4TsAuPo6wvNN8hj +K8JqBt4cMnviPfMikqQ6fRI2SxOmoWGZ02pxpEAE12STP3LkqQtKXHQ8l7YYlVIRLAw qDqA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lz4JnTW0; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id j65si50241343pge.48.2019.04.17.10.22.15; Wed, 17 Apr 2019 10:22:29 -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; dkim=pass header.i=@gmail.com header.s=20161025 header.b=lz4JnTW0; 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=pass (p=NONE sp=QUARANTINE dis=NONE) header.from=gmail.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732965AbfDQRUA (ORCPT + 99 others); Wed, 17 Apr 2019 13:20:00 -0400 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37488 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732905AbfDQRT7 (ORCPT ); Wed, 17 Apr 2019 13:19:59 -0400 Received: by mail-pf1-f193.google.com with SMTP id 8so12411409pfr.4; Wed, 17 Apr 2019 10:19:59 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=V1yIYIvLzz+BOCdxdX2gjSKybWz8E9N/6tRrpN2enDY=; b=lz4JnTW0SxRkuzYb5nVwScOlj31C+NR7Pbf9V6itmwyvo+tcPA9xux9vHCBHlmzlf8 l+V8GGCFjPLmvBpRzgeACiPtj6mSkfCDd56w0bYBQkYTi/I/GVwyrRB3giEJR/zpWrC4 Ly8vw18KA3Ytm2WNNnQcY8KjOlhY9n59X1m03ngRjQ/6YOOtXsB0oAtRdnVrdBL5lghC QBkS95ipjK32Jj5COWARIon/mFRjh9umt56N+abO+6I5bCPJQveIPH6XghPnvqF21iIb 6KuFUeO5O8Syhf418LaQuuqrU8N7SpRNvehZAKN9N0qsgeiSnMw38h0ltYF4duUQ5Hob SBzw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:subject:from:in-reply-to:date:cc :content-transfer-encoding:message-id:references:to; bh=V1yIYIvLzz+BOCdxdX2gjSKybWz8E9N/6tRrpN2enDY=; b=AB+/5bNqzE8pPKMWg9FiN//MJYp3G1BhgJSc/dK3fyktQOWyPLdJyLHxV9tntozdnb cf0TBXLrcllVT12pP2ij/P3plJTU362VNXTcaFgrE3z6smBoYcF6Lv07DaewFtujuKfi NP6rq7N5tJ26iGeQTj2VWruA8HBQKmXLw35XXy4uNP9RE8D5FJmbaFywgdAN1nTC0kKv zmgM6m3ZVGsFeua8grL5fCrQqvlyZ/lK7qzYMhTWd+X7M1zBk3j14PWDeYfUWMEd02Ma gWWq7eQRuBhglXizoJOsZB7UHsEfOWAzHZR0NKUaL6GlWws7DNW98aeaZAbGAU+XNgSH z/gw== X-Gm-Message-State: APjAAAVZar6fhiCvhSUN1mDOVEOSESRq+jGCoH0PjzVR8CtIg2UsJn0P mGI4pMZrX9G5sUA3obemFGk= X-Received: by 2002:aa7:814e:: with SMTP id d14mr90827247pfn.101.1555521598738; Wed, 17 Apr 2019 10:19:58 -0700 (PDT) Received: from [10.33.115.113] ([66.170.99.2]) by smtp.gmail.com with ESMTPSA id b7sm149466641pfj.67.2019.04.17.10.19.56 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 17 Apr 2019 10:19:57 -0700 (PDT) Content-Type: text/plain; charset=utf-8 Mime-Version: 1.0 (Mac OS X Mail 12.2 \(3445.102.3\)) Subject: Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO) From: Nadav Amit In-Reply-To: <20190417170918.GA68678@gmail.com> Date: Wed, 17 Apr 2019 10:19:54 -0700 Cc: Khalid Aziz , juergh@gmail.com, Tycho Andersen , jsteckli@amazon.de, keescook@google.com, Konrad Rzeszutek Wilk , Juerg Haefliger , deepa.srinivasan@oracle.com, chris.hyser@oracle.com, tyhicks@canonical.com, David Woodhouse , Andrew Cooper , jcm@redhat.com, Boris Ostrovsky , iommu , X86 ML , linux-arm-kernel@lists.infradead.org, "open list:DOCUMENTATION" , Linux List Kernel Mailing , Linux-MM , LSM List , Khalid Aziz , Linus Torvalds , Andrew Morton , Thomas Gleixner , Andy Lutomirski , Peter Zijlstra , Dave Hansen , Borislav Petkov , "H. Peter Anvin" , Arjan van de Ven , Greg Kroah-Hartman Content-Transfer-Encoding: quoted-printable Message-Id: <56A175F6-E5DA-4BBD-B244-53B786F27B7F@gmail.com> References: <20190417161042.GA43453@gmail.com> <20190417170918.GA68678@gmail.com> To: Ingo Molnar X-Mailer: Apple Mail (2.3445.102.3) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org > On Apr 17, 2019, at 10:09 AM, Ingo Molnar wrote: >=20 >=20 > * Khalid Aziz wrote: >=20 >>> I.e. the original motivation of the XPFO patches was to prevent = execution=20 >>> of direct kernel mappings. Is this motivation still present if those=20= >>> mappings are non-executable? >>>=20 >>> (Sorry if this has been asked and answered in previous discussions.) >>=20 >> Hi Ingo, >>=20 >> That is a good question. Because of the cost of XPFO, we have to be = very >> sure we need this protection. The paper from Vasileios, Michalis and >> Angelos - , >> does go into how ret2dir attacks can bypass SMAP/SMEP in sections 6.1 >> and 6.2. >=20 > So it would be nice if you could generally summarize external = arguments=20 > when defending a patchset, instead of me having to dig through a PDF=20= > which not only causes me to spend time that you probably already spent=20= > reading that PDF, but I might also interpret it incorrectly. ;-) >=20 > The PDF you cited says this: >=20 > "Unfortunately, as shown in Table 1, the W^X prop-erty is not = enforced=20 > in many platforms, including x86-64. In our example, the content of=20= > user address 0xBEEF000 is also accessible through kernel address=20 > 0xFFFF87FF9F080000 as plain, executable code." >=20 > Is this actually true of modern x86-64 kernels? We've locked down W^X=20= > protections in general. As I was curious, I looked at the paper. Here is a quote from it: "In x86-64, however, the permissions of physmap are not in sane state. Kernels up to v3.8.13 violate the W^X property by mapping the entire = region as =E2=80=9Creadable, writeable, and executable=E2=80=9D (RWX)=E2=80=94onl= y very recent kernels (=E2=89=A5v3.9) use the more conservative RW mapping.=E2=80=9D