Received: by 2002:a25:4158:0:0:0:0:0 with SMTP id o85csp4377383yba; Wed, 17 Apr 2019 10:10:32 -0700 (PDT) X-Google-Smtp-Source: APXvYqx2IelmzRSgdJL9wNlNYVlgnOHa0DJ92yr2WfZ77W9e9hDPSWqgRtX2vvfOB5eDL/4Fq82r X-Received: by 2002:a17:902:8349:: with SMTP id z9mr107160pln.144.1555521032565; Wed, 17 Apr 2019 10:10:32 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1555521032; cv=none; d=google.com; s=arc-20160816; b=smS+c155XmwFpqnbSTb6tQiGc4vMBH6vltLRt3KxbriQlwnToy64MRuJ+PXzlPts4f f0Pzqxbv3P+BIbkyvTfVrWxSSO9DlGimzq3n6hKtl/B3/UEdgEyiDvF9E8ucbtUrPiGN nFjM4iFD5be41LtIAghcH0yVG1MYU6MJgsNODgJvUWLUOGrmd+DsY6fyHb6kz6njik3Z +w6ooNWUoNSDsNL/412fKpPIy0fJgv/8wNnuK18THXASXjoV5zVRJZaiSLP1thVVg6zl s7LsYE+D3Gdz7vFg0EPv1UkmPVVOTkbPmCiYEsa1/nLlYYg1OwHjpcltgfWjGH3NNfNP dntA== 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:dkim-signature; bh=uI0ONQRkWQ/et5lZr2E50Xppi+adE17aj2er9uc38Ro=; b=xfKa96zjIT8DjCbDlCkoxMllxFBPgSd0DX3uhDPIQgfJGiia9hFqEL03HSZiub54/P +GBtEdFp4VX8LTwW6wpTUsSjvgaRICGBM5jfl1/G8PzLPRJtcrV8Z4EpA3fyhGSP8k0d gscpMMG3ZCTFs8Q9uSDZUHrqMrgg+kFNQCp4Y157xd2FaJ50t6DcsMcGC2Zvf5/PORR8 goYtfHsvncE4YY1+zT1IKZAZy+vxVpcOgwg3KMmnh8hwTVagEdRIpRcrv9VJop2/40rX 1J1zGow+Yx7Z6n/8Pb856/ludqxH2EOhZL2fx2l+egSBxP0w5/q18Nk2BewmxUrJt58k kiSw== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@gmail.com header.s=20161025 header.b=vQKDMpKZ; 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=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id c14si44221909pls.106.2019.04.17.10.10.17; Wed, 17 Apr 2019 10:10:32 -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=fail header.i=@gmail.com header.s=20161025 header.b=vQKDMpKZ; 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=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732922AbfDQRJZ (ORCPT + 99 others); Wed, 17 Apr 2019 13:09:25 -0400 Received: from mail-wr1-f67.google.com ([209.85.221.67]:34585 "EHLO mail-wr1-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729395AbfDQRJY (ORCPT ); Wed, 17 Apr 2019 13:09:24 -0400 Received: by mail-wr1-f67.google.com with SMTP id w16so2975554wrl.1; Wed, 17 Apr 2019 10:09:23 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=sender:date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=uI0ONQRkWQ/et5lZr2E50Xppi+adE17aj2er9uc38Ro=; b=vQKDMpKZs+jpCV0AtFjtb+IzANhqz3dew5Sd4gG7ITDXSrt8OYeyxzo5885noBmd/k M7Y511AnmRuFNpPrRUcL0fx4VCDHC5HbpoQL157ReLzEY+ATmvDFca5O27ddKmW8+E5U SWwgB4fqBVviw9oEx6R3qe3lIZgRJYJXc6M3U+vQZTc8SCcbn5I1BqHYSYodcHy/K7y2 owHfWC5l9Z1dd3sc9ZHcDGWk/J7z+eM+/y7DQCfdM2D1aY4WwXTWnRz28CERITWBN3RI OdgGC3tyQYESSIRNzNO6ctsaUz9bT+jioxPBGx1xhp3GL49llo+vdJv4lTzb9yvWN35X 0F5A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:sender:date:from:to:cc:subject:message-id :references:mime-version:content-disposition:in-reply-to:user-agent; bh=uI0ONQRkWQ/et5lZr2E50Xppi+adE17aj2er9uc38Ro=; b=NHQ/p5kSoYO4qoGi9jmIHZ6XtLTr8SMtEAkZEkvCTvCY/pJTNGN0ek9uQiwaNaXmiP +bSk8fqiAuZVhR/L9XZ/CfIfRXgHb2tKDmXMOlqECtmew1BTq4m2wLmG8sDTKYEwQ8su PJkwgbfsf1BV0dDoSwP/TwBhcruS3QWqrEscoCi3Kgd4L0ZALHBUZ7jk9XIG4LH0NOfc /HGY3ckI6ATaw+6oxDQhNrIuh89bRjJwZ4YmQXm9kRk79TPll++URksCFZRSCYckohxW 69sLlwhPYxvs/6EZ/5kXPfNrHD3ULDE9NwOT3IsIR5Y+ddUNhsK2fRQG4NfFkCZ2PRN7 hJuw== X-Gm-Message-State: APjAAAU6ueq/1QC1nAXHIg6eaRMx5f977q5CRX2bbiX2jgKTtyVGWZn6 yVoCUIwD7EDsu3YLCMFNrZA= X-Received: by 2002:adf:f8d0:: with SMTP id f16mr2701431wrq.198.1555520962630; Wed, 17 Apr 2019 10:09:22 -0700 (PDT) Received: from gmail.com (2E8B0CD5.catv.pool.telekom.hu. [46.139.12.213]) by smtp.gmail.com with ESMTPSA id 67sm2676425wmz.41.2019.04.17.10.09.19 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Wed, 17 Apr 2019 10:09:21 -0700 (PDT) Date: Wed, 17 Apr 2019 19:09:18 +0200 From: Ingo Molnar To: Khalid Aziz Cc: juergh@gmail.com, tycho@tycho.ws, jsteckli@amazon.de, keescook@google.com, konrad.wilk@oracle.com, Juerg Haefliger , deepa.srinivasan@oracle.com, chris.hyser@oracle.com, tyhicks@canonical.com, dwmw@amazon.co.uk, andrew.cooper3@citrix.com, jcm@redhat.com, boris.ostrovsky@oracle.com, iommu@lists.linux-foundation.org, x86@kernel.org, linux-arm-kernel@lists.infradead.org, linux-doc@vger.kernel.org, linux-kernel@vger.kernel.org, linux-mm@kvack.org, linux-security-module@vger.kernel.org, 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 Subject: Re: [RFC PATCH v9 03/13] mm: Add support for eXclusive Page Frame Ownership (XPFO) Message-ID: <20190417170918.GA68678@gmail.com> References: <20190417161042.GA43453@gmail.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org * Khalid Aziz wrote: > > I.e. the original motivation of the XPFO patches was to prevent execution > > of direct kernel mappings. Is this motivation still present if those > > mappings are non-executable? > > > > (Sorry if this has been asked and answered in previous discussions.) > > Hi Ingo, > > 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. So it would be nice if you could generally summarize external arguments when defending a patchset, instead of me having to dig through a PDF which not only causes me to spend time that you probably already spent reading that PDF, but I might also interpret it incorrectly. ;-) The PDF you cited says this: "Unfortunately, as shown in Table 1, the W^X prop-erty is not enforced in many platforms, including x86-64. In our example, the content of user address 0xBEEF000 is also accessible through kernel address 0xFFFF87FF9F080000 as plain, executable code." Is this actually true of modern x86-64 kernels? We've locked down W^X protections in general. I.e. this conclusion: "Therefore, by simply overwriting kfptr with 0xFFFF87FF9F080000 and triggering the kernel to dereference it, an attacker can directly execute shell code with kernel privileges." ... appears to be predicated on imperfect W^X protections on the x86-64 kernel. Do such holes exist on the latest x86-64 kernel? If yes, is there a reason to believe that these W^X holes cannot be fixed, or that any fix would be more expensive than XPFO? Thanks, Ingo