From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-2.4 required=3.0 tests=DKIM_SIGNED,DKIM_VALID, DKIM_VALID_AU,HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,SPF_HELO_NONE, SPF_PASS,USER_AGENT_SANE_1 autolearn=no autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id D3073FC6195 for ; Fri, 8 Nov 2019 15:34:15 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 96A9E21882 for ; Fri, 8 Nov 2019 15:34:15 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="rg+96yAC" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 96A9E21882 Authentication-Results: mail.kernel.org; dmarc=none (p=none dis=none) header.from=joelfernandes.org Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=owner-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix) id 191C76B0007; Fri, 8 Nov 2019 10:34:15 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id 140B86B0008; Fri, 8 Nov 2019 10:34:15 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id 07EA66B000A; Fri, 8 Nov 2019 10:34:15 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0120.hostedemail.com [216.40.44.120]) by kanga.kvack.org (Postfix) with ESMTP id E22386B0007 for ; Fri, 8 Nov 2019 10:34:14 -0500 (EST) Received: from smtpin23.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id A2152181AEF00 for ; Fri, 8 Nov 2019 15:34:14 +0000 (UTC) X-FDA: 76133506428.23.card69_24fb064863b27 X-HE-Tag: card69_24fb064863b27 X-Filterd-Recvd-Size: 4464 Received: from mail-pf1-f196.google.com (mail-pf1-f196.google.com [209.85.210.196]) by imf50.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 Nov 2019 15:34:14 +0000 (UTC) Received: by mail-pf1-f196.google.com with SMTP id n13so4843106pff.1 for ; Fri, 08 Nov 2019 07:34:13 -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=qj+fxcw/f/zBWkhx1n1H3p7wLqAe4gVBZqI/aXNQxWk=; b=rg+96yACuf0WNFAbNBolENWXNfzTsgllhU9Lu/cKxAhsm9fNVQMjn0iHib5iXLrIKy 4ht2PRAcyGbqzSaBjjbBD2EOEsb07PYkPuF9ikvH43uGaUPfIbtJk8lFDkPCLI1XR8hS 2AVs+/sUSn4eOTnMkIjAK0XPcmykZsVhmQTIg= 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=qj+fxcw/f/zBWkhx1n1H3p7wLqAe4gVBZqI/aXNQxWk=; b=ceRaaFZDrilPrcJchABHDMC/66TpiXG7Vv0pv0+9SeKW6XAvGLy8jGKSTnItliV+g9 Fto/c3eIJoYiEFuBlD4dr6tgewo8Cdf6YYnzu1EKhDE2nUX71daekcOGhTA6tcjS0udA dnl7psElxfxUZee8RLiMTpomDOdKifd6KZyDAl1E/otCG9S79bjimMV9ziDK1YRK4hYT kV1kzAXKVL+AJviUcaGx3H6jnSZXFtXcAD3lBe9lVJ5hAr+tKQI55Xbu5dLnR/GhtnV2 VJL8lWG1TFFZ5maL7YuJIpKDHCHYOwxtiFO5DiJv3xUViBXESkV1r3fQuRnxq4083JUH +frw== X-Gm-Message-State: APjAAAX87ceql+MaWlAcZU/ujuWuTjGhos192oDi7qsYmoqM7WdFbfde 8OHY5ukv2uCnFA7tI2fA1GUnSQ== X-Google-Smtp-Source: APXvYqwSoI3TF80yU99qYDKkeTfcy4sTEJwGlf6rpu9XXhNevu4ndPDIEfa5bbnolSMgHzBhXQTIQw== X-Received: by 2002:a17:90a:6583:: with SMTP id k3mr14324030pjj.50.1573227252739; Fri, 08 Nov 2019 07:34:12 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id b128sm2331777pfg.65.2019.11.08.07.34.11 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 07:34:12 -0800 (PST) Date: Fri, 8 Nov 2019 10:34:10 -0500 From: Joel Fernandes To: Greg KH Cc: Andrew Morton , 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: <20191108153410.GB99567@google.com> References: <20191107195355.80608-1-joel@joelfernandes.org> <20191107170023.0695732bb67eb80acd4caee5@linux-foundation.org> <20191108020614.GA99567@google.com> <20191108063715.GA513315@kroah.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108063715.GA513315@kroah.com> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000000, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: On Fri, Nov 08, 2019 at 07:37:15AM +0100, Greg KH wrote: > On Thu, Nov 07, 2019 at 09:06:14PM -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. 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). > > Never rely on "auto select" to pick up a patch for stable if you already > know it should go to stable. Just mark it as such, or tell stable@vger > after the fact. Sure, agreed. Thanks Andrew for adding the tags! thanks, - Joel