Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2800930imm; Wed, 3 Oct 2018 09:20:30 -0700 (PDT) X-Google-Smtp-Source: ACcGV62f9nu9hvL+5ALYJ230gDtI6iy8QV7d+2KezhmEmcJDzY7+ZgmmU7Arl0RXH7HuXCjX9gur X-Received: by 2002:a63:5922:: with SMTP id n34-v6mr2069738pgb.134.1538583630600; Wed, 03 Oct 2018 09:20:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538583630; cv=none; d=google.com; s=arc-20160816; b=SSapXal2H5i9wZ5r16MVRrc901OtbHawWlsV/2Gfp3ZMQUGGn4aHF56nuZPYYnonkR vcirSGhXGmy+F0MKc9Y/CvDJIPR+Yr95LjFhDhyqtIWOrCTqUEiWC/U7/cSAoMAqdwD0 qvyYe6J0m+S1nTARcyNyveJeYGLCMg100qP0M/h7iUl4UoUbQJn+ChHloVjkS3WACeAg 4x32Ed2//GCeLUAgkveFr3fcP4v1cxzo1P5pmw66VxdB6EfeAqKFY6q4Z6Zkq1saPHCM kpiZ58jvK2Qh3qxVplhtTNlrXTwmQN0SsKgIHbR2uTzn58UDNbWHREnIIQpHKYDPz0zq PbbQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:cc:to:subject:message-id:date:from :in-reply-to:references:mime-version:dkim-signature; bh=rvXww0whKg1t9zv0kG7x6fTxCKnRe1BGPgr/AE3sz1M=; b=Eg+3EN3OTNxl7Gv37TU/jVY6aECFQr90x+Pcq4P7d0/fVBotGtipMEA5LC78F/oc1v gCgeNxzsZDWmnJ437Bzxj6+zzfAzfghGpQE1mD/Sd9Hlt2NPQzitHA1GGuKiINjIEDWS Yb21YGTZeaccxQDB4JXGpklMtFd4Z9gemvFpJAkdGti1UD4QOwTNHkfz9ekg21jpl1JI pOPbYzBRCS5YnRSD9Lk+RHvZPIHTVl4AIpzUuXzPt1k3KPA+R106oAm/p37v+gZpHrii MbKBfK5Dhh9TEvWROVc5rc42kWWJPvejAvMb1/M4Q//wGib1yXs2ZnLNPSPAmb3tfL0G cd1g== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=XZpDXfUU; 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=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 d10-v6si1932936pla.436.2018.10.03.09.20.11; Wed, 03 Oct 2018 09:20: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; dkim=pass header.i=@kernel.org header.s=default header.b=XZpDXfUU; 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=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1727221AbeJCXIQ (ORCPT + 99 others); Wed, 3 Oct 2018 19:08:16 -0400 Received: from mail.kernel.org ([198.145.29.99]:41124 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726847AbeJCXIQ (ORCPT ); Wed, 3 Oct 2018 19:08:16 -0400 Received: from mail-wm1-f53.google.com (mail-wm1-f53.google.com [209.85.128.53]) (using TLSv1.2 with cipher ECDHE-RSA-AES128-GCM-SHA256 (128/128 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 4D42F214C3 for ; Wed, 3 Oct 2018 16:19:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1538583551; bh=jmj11tNiJRcLfpFhJtfDZwx5z6YAPzemo2oP8oI8IIQ=; h=References:In-Reply-To:From:Date:Subject:To:Cc:From; b=XZpDXfUUKwkaNCsPteab1hL0kCZC/l8AiwQMpe/CJvFQHWoVCm9WzTyQNtlzHv/JU k7deLE/CUfkr9D+42hhwPh22UV/f3cJANIJqFOTtaXzncj7lUHix/eQqNZBAjQmsOS LaUY08FZXl476JzEU6Xt8GrQQmadZMFBIjJscUTA= Received: by mail-wm1-f53.google.com with SMTP id z25-v6so8022917wmf.1 for ; Wed, 03 Oct 2018 09:19:11 -0700 (PDT) X-Gm-Message-State: ABuFfohwZsicJWs46duG7zlf5dwQiMMMNp6sHDAOORnZhdJeh2F+g8fe lDXlIQ94kGpHa7sr42Cuc82AsUASRodt1ClwwqT3pQ== X-Received: by 2002:a1c:9355:: with SMTP id v82-v6mr1978985wmd.128.1538583549561; Wed, 03 Oct 2018 09:19:09 -0700 (PDT) MIME-Version: 1.0 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> In-Reply-To: <5ddb0ad33298d1858e530fce9c9ea2788b2fac81.camel@intel.com> From: Andy Lutomirski Date: Wed, 3 Oct 2018 09:18:57 -0700 X-Gmail-Original-Message-ID: Message-ID: Subject: Re: [RFC PATCH v4 24/27] mm/mmap: Create a guard area between VMAs To: Yu-cheng Yu Cc: Eugene Syromiatnikov , 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" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On Wed, Oct 3, 2018 at 9:06 AM 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? > Various ELF loaders, perhaps? Do they use MAP_FIXED or do they just use address hints?