Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1764709ybx; Thu, 7 Nov 2019 17:02:33 -0800 (PST) X-Google-Smtp-Source: APXvYqx3cjB8GfLZ1P6e635btSbTlNGFhc7Y2UMVK2ViCbyQ8coy8quY4qVWYLSH12uSu7ibgFKg X-Received: by 2002:a50:cb8a:: with SMTP id k10mr7174008edi.21.1573174953515; Thu, 07 Nov 2019 17:02:33 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573174953; cv=none; d=google.com; s=arc-20160816; b=p8QQDpc1sGv7cTb/sWK0ah8OWHVvsvTVCTUM80QPbVspJ2Pjx9tDPeS7iaBTKAnKZN p+/HPOf7LXQa/oMnzW5UoK64k95sKKR38KAieUUhvxmsSz5RfDm1tAc8foyvaRoYAEsi CeJtLidqITtHJks1GulMz0HT6PaOVPTdyizEU4CfqQ3U0jpiJJ/W91IMlPNseDxouS4S PtVEq/gkaayjl+OzhGdsiHRPS0b4uhhHU5T53M90tLIYK0tzFD0ecnJ7yDQBIyldmRxS bHLr20GM4quYBiLYBEcbOof9AjyvCaT4QgNlB4NiDFgO+BdAG5QQdQqW30gvrnRyMy+D jGgA== 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:message-id:subject:cc:to:from:date :dkim-signature; bh=w/tnq2VSpPqXjwtlveR5kpS74YN9Hpe9lqZ1x21/WgI=; b=0sUs1BxR20eECa6mKtcwYOsGPRVFSmVfF3xYiDzXLAWxYItNNeDTxMa2KXRaMrYQxk WgbPBx2qf7hdsoKzQMiyWYkpjmVHiGKYppa1XPEZIR1EmrzsFi7C1jr/YRSYzEapx7/A 8wKYzwCXgLky+7/z5f5bg74EPlt97c0EpC9BfAfr6IbzuLcBm+0NSF4cSweNZaGLBSbn eHg2wk7766SEyOJ7oE0F/aPTWi8a5T/2iTvNfCo9JKDKK+4A6FKCAQ2N+rLzZiTvoQsw spHB9Qu6YyP7mMwh7PaTgJlb6mQ0qHkQQwk4GI2LUU3bS9I2SMYNhH147pz66o8Eak9d ZbYQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b="T0b/+HM0"; 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 w56si2914181eda.376.2019.11.07.17.02.09; Thu, 07 Nov 2019 17:02:33 -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=@kernel.org header.s=default header.b="T0b/+HM0"; 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 S1727102AbfKHBAZ (ORCPT + 99 others); Thu, 7 Nov 2019 20:00:25 -0500 Received: from mail.kernel.org ([198.145.29.99]:37278 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725946AbfKHBAY (ORCPT ); Thu, 7 Nov 2019 20:00:24 -0500 Received: from localhost.localdomain (c-73-231-172-41.hsd1.ca.comcast.net [73.231.172.41]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id C35602178F; Fri, 8 Nov 2019 01:00:23 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573174824; bh=jRakB92CDtqhebD1jrBrh1EUmgiQvq5dv4RO4lG0uak=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=T0b/+HM0RC9jlc/Xq50EtnaAkPrOya0KFpSixIVIYUh/F1621mTGaIvUiYRMaVaHq p7TbDiSV4dyCQTF4eaYDrdu+eLPXk06EZF6uGhOHGqB6B2gmTZk+crUjzrP5Ugpe8W FpDssw4Hr4zEx7BBp21XV7vK+1ysSHLc94iSChSQ= Date: Thu, 7 Nov 2019 17:00:23 -0800 From: Andrew Morton To: "Joel Fernandes (Google)" Cc: linux-kernel@vger.kernel.org, Nicolas Geoffray , kernel-team@android.com, Hugh Dickins , linux-kselftest@vger.kernel.org, linux-mm@kvack.org, Shuah Khan Subject: Re: [PATCH 1/2] memfd: Fix COW issue on MAP_PRIVATE and F_SEAL_FUTURE_WRITE mappings Message-Id: <20191107170023.0695732bb67eb80acd4caee5@linux-foundation.org> In-Reply-To: <20191107195355.80608-1-joel@joelfernandes.org> References: <20191107195355.80608-1-joel@joelfernandes.org> X-Mailer: Sylpheed 3.5.1 (GTK+ 2.24.31; x86_64-pc-linux-gnu) Mime-Version: 1.0 Content-Type: text/plain; charset=US-ASCII 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, 7 Nov 2019 14:53:54 -0500 "Joel Fernandes (Google)" wrote: > F_SEAL_FUTURE_WRITE has unexpected behavior when used with MAP_PRIVATE: > A private mapping created after the memfd file that gets sealed with > F_SEAL_FUTURE_WRITE loses the copy-on-write at fork behavior, meaning > children and parent share the same memory, even though the mapping is > private. That sounds fairly serious. Should this be backported into -stable kernels?