Received: by 2002:ad5:474a:0:0:0:0:0 with SMTP id i10csp1629885imu; Fri, 9 Nov 2018 21:46:21 -0800 (PST) X-Google-Smtp-Source: AJdET5d/5tI0OWFjfLSrc43dj/VYn2vQJ944OvBdC8Ly4Z26kTnSdVAyjyyb7Yiw6CRfy/9kVosu X-Received: by 2002:a63:5c22:: with SMTP id q34mr2582109pgb.417.1541828781005; Fri, 09 Nov 2018 21:46:21 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1541828780; cv=none; d=google.com; s=arc-20160816; b=ZPOyXPXMFNhJFwVIRQ6cXXP6bPQr72BqWGcXBzMSUZQHdcI++0juMysoOXZKMcPhQZ RroX45tmEps6IDRbKbpm1H24v39Qkr+BzQ3llmg2hyO9yLTaWshCNbGp//B3nY/KXEX5 HLXdDL8UAYPTQtRZWZvYes/Fs10L0H9KT3jrC5k6tqsCaLwK4D+eYC23J3B3ahSYl77v 7c53IvxSMp8Et1F+yWIWBkMyeJ5FlmE7Paoftajihy+/QI7Grbf9YKeNakkqHO6HXsZm nLCbSYMgwfBrw/hUDTh4F8kgOhqXQPOzizukv0NjHN8gumgG45kaiIf+1JpfbS5o5727 jlZA== 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=Pfuk88+N7vewG5mvrswitDW+c4hJAo1IWigof7AdliU=; b=HibDiKzof4IyHm22JR0Qn1+xbBYJAFrksyE/Fms4Kh3/QsOq+wLJXrJyMAjpqGm9Sw Rc6Am3Un28q43GefyOLx3XTcq9xaIZCu0Nq3LoIzK7fTKK7QSiX2bf2ieanoq1PRenql H5ByVsHFM0fenfenH/5TAz5M44OVlqnh4OUWfzBu/zUxjOLT7zRD+egQR37YZB4tl5sU lQfhGnKGYN7XkqKNo5B+WSDnDTDKhdwoNthEDdZMlN+w+GWX4FEKSHXfboPPK1HpI92q FKAgXd1NZvvW/ij/r0cVqQcYYM7lsMxTus0oop3bahIgcq264DSOd3ypDrn1vvaaMQGp T0ZQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=sacMhAtM; 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 Return-Path: Received: from vger.kernel.org (vger.kernel.org. [209.132.180.67]) by mx.google.com with ESMTP id b124-v6si10607362pfg.90.2018.11.09.21.46.05; Fri, 09 Nov 2018 21:46:20 -0800 (PST) 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=@joelfernandes.org header.s=google header.b=sacMhAtM; 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 Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728833AbeKJP15 (ORCPT + 99 others); Sat, 10 Nov 2018 10:27:57 -0500 Received: from mail-pf1-f193.google.com ([209.85.210.193]:37109 "EHLO mail-pf1-f193.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1728644AbeKJP15 (ORCPT ); Sat, 10 Nov 2018 10:27:57 -0500 Received: by mail-pf1-f193.google.com with SMTP id u13-v6so1879719pfm.4 for ; Fri, 09 Nov 2018 21:44:12 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=joelfernandes.org; s=google; h=date:from:to:cc:subject:message-id:references:mime-version :content-disposition:in-reply-to:user-agent; bh=Pfuk88+N7vewG5mvrswitDW+c4hJAo1IWigof7AdliU=; b=sacMhAtMTkOuS+oVmP123FMHPpniFOQG2ZWzfCZVBN6i6FbUwC2iMOQBnQIu+QkbYD 5g3XuQyG6C7ixQXLd6q8H2fVkwgWQncRSmVHP+3IIrHiHM+XHocDNxoaT7yIoBxFFRX4 iRxcn8qhvqCbMjZuEbs9/e4lWRPIs9is0bURw= X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:references :mime-version:content-disposition:in-reply-to:user-agent; bh=Pfuk88+N7vewG5mvrswitDW+c4hJAo1IWigof7AdliU=; b=pg3MXsbFIAz9IInBJYuKZ5xzhByF3RDl40qO+LWqKQz3osCptamkbuKuMKRrL5M/WR CMmwNYxMd4c3X46ZA6KACe6Mb904yThyIiKktvP03JAxNHne5TqltxEL55dARTLIstLV +/XgyCWUMArSK7CSmPjTNTn5XOnOIJfRPJbnZZkxEgIUTQ5EyhTn0nNcQPGC41cxXw2p SxErcd5iIwKFn5Wn2d9O4u8m5HGd7+Nl/yOTsqffRxMItu/Dp2opavvdeJk3jbqPIoh4 JVx+mZ60sripurx/GkMIyxUwBRo5JRcf8xz6JBrQn8YPJYaKcE3WzhvnouWASB9Ct13L N7fA== X-Gm-Message-State: AGRZ1gIeRZnnL7OyTp4IBBsfli8WI8eL9RophUSL/gn/s3PmoL9FLWtz 8VpbL52Pn+dUpHE605EC6ILbQA== X-Received: by 2002:aa7:8498:: with SMTP id u24-v6mr11605932pfn.220.1541822086095; Fri, 09 Nov 2018 19:54:46 -0800 (PST) Received: from localhost ([2620:0:1000:1601:3aef:314f:b9ea:889f]) by smtp.gmail.com with ESMTPSA id 69sm3101587pgg.86.2018.11.09.19.54.44 (version=TLS1_2 cipher=ECDHE-RSA-CHACHA20-POLY1305 bits=256/256); Fri, 09 Nov 2018 19:54:44 -0800 (PST) Date: Fri, 9 Nov 2018 19:54:43 -0800 From: Joel Fernandes To: Andrew Morton Cc: linux-kernel@vger.kernel.org, jreck@google.com, john.stultz@linaro.org, tkjos@google.com, gregkh@linuxfoundation.org, hch@infradead.org, Al Viro , dancol@google.com, "J. Bruce Fields" , Jeff Layton , Khalid Aziz , Lei Yang , linux-fsdevel@vger.kernel.org, linux-kselftest@vger.kernel.org, linux-mm@kvack.org, =?iso-8859-1?Q?Marc-Andr=E9?= Lureau , Mike Kravetz , minchan@kernel.org, Shuah Khan , valdis.kletnieks@vt.edu Subject: Re: [PATCH v3 resend 1/2] mm: Add an F_SEAL_FUTURE_WRITE seal to memfd Message-ID: <20181110035443.GA26579@google.com> References: <20181108041537.39694-1-joel@joelfernandes.org> <20181109123634.6fe7467bb9237851250c9c56@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20181109123634.6fe7467bb9237851250c9c56@linux-foundation.org> 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 On Fri, Nov 09, 2018 at 12:36:34PM -0800, Andrew Morton wrote: > On Wed, 7 Nov 2018 20:15:36 -0800 "Joel Fernandes (Google)" wrote: > > > Android uses ashmem for sharing memory regions. We are looking forward > > to migrating all usecases of ashmem to memfd so that we can possibly > > remove the ashmem driver in the future from staging while also > > benefiting from using memfd and contributing to it. Note staging drivers > > are also not ABI and generally can be removed at anytime. > > > > One of the main usecases Android has is the ability to create a region > > and mmap it as writeable, then add protection against making any > > "future" writes while keeping the existing already mmap'ed > > writeable-region active. This allows us to implement a usecase where > > receivers of the shared memory buffer can get a read-only view, while > > the sender continues to write to the buffer. > > See CursorWindow documentation in Android for more details: > > https://developer.android.com/reference/android/database/CursorWindow > > It appears that the memfd_create and fcntl manpages will require > updating. Please attend to this at the appropriate time? Yes, I am planning to send those out shortly. I finished working on them. Also just to let you know, I posted a fix for the security issue Jann Horn reported and requested him to test it: https://lore.kernel.org/lkml/20181109234636.GA136491@google.com/T/#m8d9d185e6480d095f0ab8f84bcb103892181f77d This fix along with the 2 other patches I posted in v3 are all that's needed. thanks! - Joel