Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2651842imm; Thu, 11 Oct 2018 13:54:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV61mn3LYlWxiriFebQljpAW4YdpteU5J280PiU0o3EjHh1yvq4B/LWTGFIM/n0Al9CoZhAFk X-Received: by 2002:a62:4ec9:: with SMTP id c192-v6mr3058282pfb.221.1539291270737; Thu, 11 Oct 2018 13:54:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1539291270; cv=none; d=google.com; s=arc-20160816; b=flNgftziaxpgkM5IWP2qGbUkf9JEH2mhW5Mz6KiTHCNIULBd7Uacce9xs2uoekH6VS WlLcZjdp/3jZWVn5+GQgZpPsGoyv9hYXjkBEmdlnX8v5F3AxN4R3yRPoSp3QL2PZaRxR QRvNgOKbSE7OtGKfkOD2zf6/PqGU5XCNNayOhuxyQH31f28UpWck8t2Pz78Cyi+98SuH eWKga1CAXXEaT65cMvKyTihhj//eKLQ7eDclfrlqKjfl4cvrBVTvmUx2CZXXBaO1s3O+ 8mnuA1WMRTLMsq3O3Gq9b++UBaxyYudFpkH5ECpPEPIRBzwplw46RK0MVxtsdz1kZYbl wUqA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:content-transfer-encoding:mime-version :references:in-reply-to:date:cc:to:from:subject:message-id; bh=3MVzU8q+udxszgDPNegl4iidBA9e0WSxD23vvP1VxlM=; b=VUd7b9w1lMsjOB27D9hHEPQSku3eBoNfvS/Yp5plL1vmRnfBoi1LhYwkyw2nfqgbw9 THIYzWAdoMeOqKuxPH8ZRitad1bhEaVp4oZSy6ZDScYbtKudEOdtWM7u7ExSOXhJdPVc BazxQEalrMAJiwJfiSoNbwXmQOMeiVvtdDU/Q/q/fitDiF27AeVF3jfSBuWtTH0U6sN9 OENg7PkVS0vTXaq9x8yyXPMACuyNTczpQigp3lX391t53ghqMuan0Oa3j0PQdKuT9Sc1 oTrFasXZA8jt1zrN1ZQnet5ZLUzuL5+2ew4D7fApVLWx6Zx5EfygN064Gzxklkt5Uf+M bXlA== 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 d81-v6si33527191pfm.40.2018.10.11.13.54.16; Thu, 11 Oct 2018 13:54:30 -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 S1726762AbeJLEWq (ORCPT + 99 others); Fri, 12 Oct 2018 00:22:46 -0400 Received: from mga14.intel.com ([192.55.52.115]:50401 "EHLO mga14.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725819AbeJLEWp (ORCPT ); Fri, 12 Oct 2018 00:22:45 -0400 X-Amp-Result: SKIPPED(no attachment in message) X-Amp-File-Uploaded: False Received: from fmsmga001.fm.intel.com ([10.253.24.23]) by fmsmga103.fm.intel.com with ESMTP/TLS/DHE-RSA-AES256-GCM-SHA384; 11 Oct 2018 13:53:47 -0700 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.54,369,1534834800"; d="scan'208";a="98441634" Received: from 2b52.sc.intel.com ([143.183.136.147]) by fmsmga001.fm.intel.com with ESMTP; 11 Oct 2018 13:53:47 -0700 Message-ID: Subject: Re: [PATCH v5 07/27] mm/mmap: Create a guard area between VMAs From: Yu-cheng Yu To: Jann Horn , Andy Lutomirski Cc: the arch/x86 maintainers , "H . Peter Anvin" , Thomas Gleixner , Ingo Molnar , kernel list , linux-doc@vger.kernel.org, Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Eugene Syromiatnikov , Florian Weimer , hjl.tools@gmail.com, Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , rdunlap@infradead.org, ravi.v.shankar@intel.com, vedvyas.shanbhogue@intel.com, Daniel Micay Date: Thu, 11 Oct 2018 13:49:00 -0700 In-Reply-To: References: <20181011151523.27101-1-yu-cheng.yu@intel.com> <20181011151523.27101-8-yu-cheng.yu@intel.com> Content-Type: text/plain; charset="UTF-8" X-Mailer: Evolution 3.28.1-2 Mime-Version: 1.0 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Thu, 2018-10-11 at 22:39 +0200, Jann Horn wrote: > On Thu, Oct 11, 2018 at 5:20 PM Yu-cheng Yu wrote: > > Create a guard area between VMAs to detect memory corruption. > > [...] > > +config VM_AREA_GUARD > > + bool "VM area guard" > > + default n > > + help > > + Create a guard area between VM areas so that access beyond > > + limit can be detected. > > + > > endmenu > > Sorry to bring this up so late, but Daniel Micay pointed out to me > that, given that VMA guards will raise the number of VMAs by > inhibiting vma_merge(), people are more likely to run into > /proc/sys/vm/max_map_count (which limits the number of VMAs to ~65k by > default, and can't easily be raised without risking an overflow of > page->_mapcount on systems with over ~800GiB of RAM, see > https://lore.kernel.org/lkml/20180208021112.GB14918@bombadil.infradead.org/ > and replies) with this change. Can we use the VMA guard only for Shadow Stacks? Yu-cheng