Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1899612ybx; Thu, 7 Nov 2019 19:28:26 -0800 (PST) X-Google-Smtp-Source: APXvYqzQGygVvK37qVjU0SpBoUjw49Nhj1wD2O/j+90JN/zt01mjHKNLOrnGL+XFc8gaubDqKtOD X-Received: by 2002:a17:907:4300:: with SMTP id oa24mr6574350ejb.8.1573183706805; Thu, 07 Nov 2019 19:28:26 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573183706; cv=none; d=google.com; s=arc-20160816; b=DrLiatrfEWkUR8iwa0BRQkrXNWqXAPEs6d6niM7ZSF33zTL9ujptl0dTlS196Z/17+ d/bNT9CHZqhHZ7g+PQkLufFhPrcyIITHhjKLCqpiQjP5xbm+9AVeOXETRNh1cX+QF+1X 2FAwnj2DSU2lZU6GjgkcqajLBIM/BmxqmZtVQRUyZCwrtREFx+VsX+YWHzPb8G//V5/t b0ON8Flh2wxkDNmCS0OEuO8rvzFRGckon/pB/fvEZ20rnrOTnYEWP19pTwyklValfo1s EyrOMuB9Wwfd6GNogY77BtmnGJ5bs4MHMkwHJuGc78RTt3xKU6GYptnks4D3gag7vZSa psCQ== 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=FgNaw5wGLpyCD2UTaQhvEl6qSMm5PAyCtWK5AvoTnrg=; b=JnQD19L9Oh0x77lDFyAw/X3qHBVqWf/cfWBOO4dHEV0iXqVaAFEPgic52L7ZXj5XPh XxqYMMKV7I4Vi5wKz/SmNG3BFpnvZJd4gWFxuWaeLcUS4gioNQGJIulturSqndL3hqYK YF6WOY570RKhelkyA+K2F+CZ0zrUjf2EcMlMdBiL6ggWFXaqnYIwCBIUKzFhBNENI/Gp ePcj2x131yNObgLo1UrwF49F6g3ywwv6I6GjuOOWrQVJ01wH/blr2Gs0Zv6eEI+umhtj 1nKLQ7NHcN4uj1YvHHIIkFMdbie1Z9vPvAVv5lt/FFt1/NbCOwtZ/MMHwzDJg9DA+fzT 4jfg== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=default header.b=EL2vfDt6; 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 a16si2704665ejs.215.2019.11.07.19.28.03; Thu, 07 Nov 2019 19:28:26 -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=EL2vfDt6; 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 S1729509AbfKHDZa (ORCPT + 99 others); Thu, 7 Nov 2019 22:25:30 -0500 Received: from mail.kernel.org ([198.145.29.99]:38220 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1726219AbfKHDZ3 (ORCPT ); Thu, 7 Nov 2019 22:25:29 -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 B0C222084D; Fri, 8 Nov 2019 03:25:28 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1573183529; bh=OQWLutCvyBNF31F7nVyat1ronJZrpce2IWGhQEDJklg=; h=Date:From:To:Cc:Subject:In-Reply-To:References:From; b=EL2vfDt6Mw43aU8kaHTYInmtABbFRAMAOtsu/cUlsSL+yYrhw0c5kItTFOXfkIjl8 Y0b/qWgeolc6lq72oqbSsaPu3G7EN0ptlwK005z41DkQtbsDfU/HxzMGK8hKMkguIH SfXE8gnrqWFYUWlSvy6ewTwdns60UlSGCNDkbslM= Date: Thu, 7 Nov 2019 19:25:28 -0800 From: Andrew Morton To: Joel Fernandes 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: <20191107192528.0c22e8e122a04d4f8d29c5eb@linux-foundation.org> In-Reply-To: <20191108020614.GA99567@google.com> References: <20191107195355.80608-1-joel@joelfernandes.org> <20191107170023.0695732bb67eb80acd4caee5@linux-foundation.org> <20191108020614.GA99567@google.com> 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 21:06:14 -0500 Joel Fernandes wrote: > On Thu, Nov 07, 2019 at 05:00:23PM -0800, Andrew Morton wrote: > > 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? > > Yes, it should be. I added Fixes: ab3948f58ff84 ("mm/memfd: add an F_SEAL_FUTURE_WRITE seal to memfd") Cc: > The F_SEAL_FUTURE_WRITE feature was introduced in v5.1 so > v5.3.x stable kernels would need a backport. I can submit a backport tomorrow > unless we are Ok with stable automatically picking it up (I believe the > stable folks "auto select" fixes which should detect this is a fix since I > have said it is a fix in the subject line). The Cc:stable tag should trigger the appropriate actions, assisted by the Fixes:. I doubt if "fix" in the Subject has much effect.