Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2814334imm; Wed, 3 Oct 2018 09:32:33 -0700 (PDT) X-Google-Smtp-Source: ACcGV62Ix5Af49+JfCo3PSnfOy4ZczEO0C6TCfScZ6TzimylRBOeoweNmi97tzXtdF0SRl0R329U X-Received: by 2002:a62:9850:: with SMTP id q77-v6mr2208800pfd.249.1538584353222; Wed, 03 Oct 2018 09:32:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538584353; cv=none; d=google.com; s=arc-20160816; b=THd2DHSvyp2EQjjlk+s+ERBmZsJ1iivuXqkFPh2W9cpkySbG8lXjKE9S6gZwgPvD1z nH/2MtWiHQrgR+sRZjXJE5KwtSlflBqTdve5WPd9malpFZVFgjQx2sM33LexnVH2LxMY v+XcIHZNg+X6Ixs8qSLRJOt334rYlunhrmNsucDusK6ocY5IlqlyutM2yCINUvRnPbeX ORLE8HXvMr2xZHiJMTSmoQ05UaU3udaCcnuWNcWRseRQzncpnMZW+/Z7GX1+o75lnZNj hHAkG7qp/bGgDWfdJw6RNjuGf3rGaqddHm6q4I9I/XrBHDKzrNwEjgRNRrTfucbNAozf W2bA== 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=SV6X4qkP/pt6SU+aHWy8KT/sefM8VX9H6B9IxYfSrvc=; b=mBf55SLITVe49aUeH1C4nAP3K/4u/ne/gIsmAHODlsayu5iZFII4PfkfOEsT2jqpqf K5Gx3SHzJGdY7WQtF69woHNf4/e9RVpTCiUFIMpQMBblzL3vjqCCg0GvS8WvQMJiMMGb oFITM5NzSVr0bv8vneKNwck4f/D/fUaMGLUmUBtvToW8p2EuWznARgZDvZ5ewTqZOufl fuy8jEM2pXNSHQTN89aCDurz6oa2/1V9CHYRUZEfmOf9KZIQU+htgCw6rxxUDer4h+8h /Lu2+UAzLvwqaRJcz5hYnXJlHLwdc3UokNkLHPrbFf0AwEy8FKnggjgnlxGW5gaU2nDc FxJg== 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=redhat.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id s22-v6si1946011plp.336.2018.10.03.09.32.17; Wed, 03 Oct 2018 09:32:33 -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=redhat.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726950AbeJCXVS (ORCPT + 99 others); Wed, 3 Oct 2018 19:21:18 -0400 Received: from mx1.redhat.com ([209.132.183.28]:51848 "EHLO mx1.redhat.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726829AbeJCXVS (ORCPT ); Wed, 3 Oct 2018 19:21:18 -0400 Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id 5EC9B3084026; Wed, 3 Oct 2018 16:32:10 +0000 (UTC) Received: from asgard.redhat.com (ovpn-200-25.brq.redhat.com [10.40.200.25]) by smtp.corp.redhat.com (Postfix) with ESMTPS id E1E9B87DB; Wed, 3 Oct 2018 16:31:57 +0000 (UTC) Date: Wed, 3 Oct 2018 18:32:26 +0200 From: Eugene Syromiatnikov To: Yu-cheng Yu Cc: Andy Lutomirski , X86 ML , "H. Peter Anvin" , Thomas Gleixner , Ingo Molnar , LKML , linux-doc@vger.kernel.org, Linux-MM , linux-arch , Linux API , Arnd Bergmann , Balbir Singh , Cyrill Gorcunov , Dave Hansen , Florian Weimer , "H. J. Lu" , Jann Horn , Jonathan Corbet , Kees Cook , Mike Kravetz , Nadav Amit , Oleg Nesterov , Pavel Machek , Peter Zijlstra , Randy Dunlap , "Ravi V. Shankar" , "Shanbhogue, Vedvyas" Subject: Re: [RFC PATCH v4 24/27] mm/mmap: Create a guard area between VMAs Message-ID: <20181003163226.GC9449@asgard.redhat.com> References: <20180921150351.20898-1-yu-cheng.yu@intel.com> <20180921150351.20898-25-yu-cheng.yu@intel.com> <20181003045611.GB22724@asgard.redhat.com> <5ddb0ad33298d1858e530fce9c9ea2788b2fac81.camel@intel.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <5ddb0ad33298d1858e530fce9c9ea2788b2fac81.camel@intel.com> User-Agent: Mutt/1.5.23 (2014-03-12) X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.40]); Wed, 03 Oct 2018 16:32:10 +0000 (UTC) Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 03, 2018 at 09:00:04AM -0700, Yu-cheng Yu wrote: > On Tue, 2018-10-02 at 22:36 -0700, Andy Lutomirski wrote: > > On Tue, Oct 2, 2018 at 9:55 PM Eugene Syromiatnikov wrote: > > > > > > On Fri, Sep 21, 2018 at 08:03:48AM -0700, Yu-cheng Yu wrote: > > > > Create a guard area between VMAs, to detect memory corruption. > > > > > > Do I understand correctly that with this patch a user space program > > > no longer be able to place two mappings back to back? If it is so, > > > it will likely break a lot of things; for example, it's a common ring > > > buffer implementations technique, to map buffer memory twice back > > > to back in order to avoid special handling of items wrapping its end. > > > > I haven't checked what the patch actually does, but it shouldn't have > > any affect on MAP_FIXED or the new no-replace MAP_FIXED variant. > > > > --Andy > > I did some mmap tests with/without MAP_FIXED, and it works as intended. > In addition to the ring buffer, are there other test cases? Right, after some more code reading I figured out that it indeed shouldn't affect MAP_FIXED, thank you for confirmation. I'm not sure, however, whether such a change that provides no ability to configure or affect it will go well with all the supported architectures.