Received: by 2002:ac0:a582:0:0:0:0:0 with SMTP id m2-v6csp2836816imm; Wed, 3 Oct 2018 09:53:29 -0700 (PDT) X-Google-Smtp-Source: ACcGV63EuVqJsgfugDyGe1CuBmav4ftAAW3cC6T6MLH0zUaWwbE5fHvM7DhWnq/9Hf97ks4prO4r X-Received: by 2002:a63:4723:: with SMTP id u35-v6mr1184655pga.95.1538585609118; Wed, 03 Oct 2018 09:53:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1538585609; cv=none; d=google.com; s=arc-20160816; b=NWIdmNxKYsYZeRbFtj0oPlzdPncf94Jj4qXdBAiVZlxNs4idhFVtnpAIKui7NKNy5f c6uiVbgo2ExE8M7mEbpsHnedmjUVu6+utrDfEfNjxpmwNb78tHLBszk6Ko/LP/YLt48Y gEX2qhjjCAQbICa9NG2RayL+BFL0a0/LT0Ic57xn/vrf0IWLLMmE5OAepgBfUbHiuElW a7UKLnNFyGDvKMVbSDOtcmBQ8jZd/p/BRNXouuPmMxgyddjghtoGRZ9LqnbdlBIXNVg9 GooepRbvkVhRyp0bSAtzj5196w6LMvR/McgFZkQ/qCNFtryDQhFVyqAyujzREzX/03d1 ixWQ== 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=nOMoFA3pt/QNOFKVsymAykXxw42vbOxgzwDRgQONvqg=; b=hSUFrMU+398sCjWTJKAZb15rdnsMYulzWYk4iO1f9GfUPC8HbbnDETzIF9erp9eZJQ BrZER04GYc7EUBiOlPkgtYsUKSut1xo1Tk1XDFKiTnw9iSNYHK7uELN+FaDwUZ4zoKAy AlQsIyfmbDnLo8lSwl4hvv4EMbP40jZXiYhie8Hd2LbKCfQmQ975n/TFrjGVPCBOnB8g m+mXo84W/XTx/HDndBHfP1YzNyo5i/TJmIsRQjaANTbDhgg+X5IcwFFrZ69K6LrU2uLC /sr334bNcc5Bv4PO9S9RmApFzcbuCnQrfD+6+anA9vHKvcyr+94asISFTlhW6hC343Yu D8Pw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@google.com header.s=20161025 header.b=KwTNb3H7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id e13-v6si1704603pge.0.2018.10.03.09.53.12; Wed, 03 Oct 2018 09:53: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=@google.com header.s=20161025 header.b=KwTNb3H7; 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=REJECT sp=REJECT dis=NONE) header.from=google.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1726964AbeJCXmT (ORCPT + 99 others); Wed, 3 Oct 2018 19:42:19 -0400 Received: from mail-oi1-f196.google.com ([209.85.167.196]:42671 "EHLO mail-oi1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726884AbeJCXmT (ORCPT ); Wed, 3 Oct 2018 19:42:19 -0400 Received: by mail-oi1-f196.google.com with SMTP id w81-v6so5087272oiw.9 for ; Wed, 03 Oct 2018 09:53:07 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=20161025; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=nOMoFA3pt/QNOFKVsymAykXxw42vbOxgzwDRgQONvqg=; b=KwTNb3H7GJ22hmUX3//uimOh8uaXG4prsMS3Q1oIb/u8ig/iSyMkdORLercP6AudDx GypyylYCdQ8U6AS4mxmQZyqMqpjVOnaKZ5LMriU1RBuzrm9SX8SaUIHVYTpuuGVqUOAW QrNTYZSKZ3VQR6g+Z6G1h7U4XtLkU64BpJUhsNwbQSuWNlLA+iJhzozoBtiaqP9zp/g3 iPWX/E1ehxsMuAwOpIfO9k70VOge5RkoCRjVdEYPUOtATM1lFv2oagfBdCmBbcVS1c3I AoGG3ywH5uziYCeHth3pZac/8sYfgwB/L9raS44ZDWXELXErApSGVy/X+mGSDs+HAzmm Offw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=nOMoFA3pt/QNOFKVsymAykXxw42vbOxgzwDRgQONvqg=; b=n5GiEWERHp4+h2pIpOOEOnbH6z4ITC0aTnwpYPEq+QjK/qir3nxdMxX0+IjWnPgGsz aH+0FPZRfd/IVIhambcC0tMMw7Hvdl7VDNv6jcZCaZcInoM7m2e3inYWLvokFLafBpGg u/A2D6TFDMdEyIXiV2dJdrAkx/xLQw2cNfE8HZCe4nK+DqqGQLxoodxL1r7MTLWOVZL1 B9F7ZXk82W6seGkdhAE0pd6uhQGbuHgtNG4tM/xtc1FO4WzkRTIfwD0rXW4Gxv79yrer mZ2kb9ykKhm5/2Fu42QWzI1ql/SgUM6OZ2/VcOb68FOAflQFZWxzvu/ic2iLBhiDuFxG snNw== X-Gm-Message-State: ABuFfoiR71jJOie5grCUUS57iehEX6PyzQ+hGnrj0iLgShW+RmXH+MeE i4OCbq4P/Jk0ebl7GfGenypYK/2bM23tORhd/BYPEA== X-Received: by 2002:aca:d513:: with SMTP id m19-v6mr1205223oig.82.1538585586555; Wed, 03 Oct 2018 09:53:06 -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> <20181003163226.GC9449@asgard.redhat.com> In-Reply-To: <20181003163226.GC9449@asgard.redhat.com> From: Jann Horn Date: Wed, 3 Oct 2018 18:52:40 +0200 Message-ID: Subject: Re: [RFC PATCH v4 24/27] mm/mmap: Create a guard area between VMAs To: Eugene Syromiatnikov Cc: yu-cheng.yu@intel.com, Andy Lutomirski , "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 , 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 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 6:32 PM Eugene Syromiatnikov wrote: > 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. Is there a concrete reason why you think an architecture might not like this? As far as I can tell, the virtual address space overhead should be insignificant even for 32-bit systems.