Received: by 2002:a25:31c3:0:0:0:0:0 with SMTP id x186csp1830210ybx; Thu, 7 Nov 2019 18:09:22 -0800 (PST) X-Google-Smtp-Source: APXvYqzEjQrM2t3uLFPSYBMQFeU2Ln1PChMTXV2PzBjOueP+DoRgwHv6d5wv7Sbn8cHzUMz0Hs// X-Received: by 2002:a17:906:76c9:: with SMTP id q9mr6424345ejn.53.1573178962727; Thu, 07 Nov 2019 18:09:22 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1573178962; cv=none; d=google.com; s=arc-20160816; b=nEBcPPtMPkguVQg2ENcqnGDXiHYNW6x8kdrwn/yUheA5bJdh4P2XD/U/Ic3m/trZ16 3juk1mMD1XLUDkiaeJglxGyavUdyIbEhUIKfEVu7I0J4gVJA6+c4IXQE6IdlAl1JJToc eqSzdciRcfJluiY/0+j8T9AbEDWPf6gXACqvK5Wi94ubaRpyR98srNhV3vxIKvTDkUbO efEK8gAvtyz9TCY636U2mMbc13RiZ8hAcVASEzyr/GhsOYr0o1b+po3RdpVvTdaWZZ4Z q4sEGkV/KGBPozGxRRT1uen2ghW7yGEO2tgbY8EEVMiQA9ja455YfftDNIm/9iKp6iJE xISA== 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=JaGTE9xsOVFxxMt/cA2eBRyj5tRBj9D9pcr4/X/7/Hc=; b=MAZAw8DiX9M+GjxVDhTc3UaL6YOx0m+J1YWkgyFMx5ZJ1udgZt/vj/Zf2gCrPTkeSe kZ1Jk8gS0g4BaK34UF3ZjLH1xhh88yyO0PDLUj1Bh+KUf/DzkF0wQzFUeTCKOSQiN1od 5a/kj82Ma3MTjUXlFdTpf7tZUgvmBQYU4f2NUUxaxP2nt7mBBCdIOIaMISLO2F8Apqa8 V6C9FK3XYLAqMWUIskpWIB+7bEbzNdwzwitgd1eTpaUWuIfiafiHbxQn1nNkSntCW465 0An7huYUQutic4y9eeyqqB8oi82YcRuJYiyCr5TfZjJKKizg40wQ9gZxiNItDM/ur/OA cLYw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@joelfernandes.org header.s=google header.b=uUZbZSTp; 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 ce11si2899391edb.391.2019.11.07.18.08.59; Thu, 07 Nov 2019 18:09:22 -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=uUZbZSTp; 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 S1728370AbfKHCGT (ORCPT + 99 others); Thu, 7 Nov 2019 21:06:19 -0500 Received: from mail-pl1-f196.google.com ([209.85.214.196]:33706 "EHLO mail-pl1-f196.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1725928AbfKHCGS (ORCPT ); Thu, 7 Nov 2019 21:06:18 -0500 Received: by mail-pl1-f196.google.com with SMTP id ay6so2980524plb.0 for ; Thu, 07 Nov 2019 18:06:17 -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=JaGTE9xsOVFxxMt/cA2eBRyj5tRBj9D9pcr4/X/7/Hc=; b=uUZbZSTpPy0TgAGNv3jrIWK3JHr+zC+3C75cT059FtvmZCjpz8HRuuy0u2yKf8LKP4 8p5F+h1RuamrezvEcl2taulHvc02s7OMp7cVqQ3JpPexXj/+tsMAdHV//CFh52TEhMZl yDXV+8hT+AMYciNbo8EQHAQG/1zj7/1e6P5+U= 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=JaGTE9xsOVFxxMt/cA2eBRyj5tRBj9D9pcr4/X/7/Hc=; b=LTLSc71SEOUidXrWJ1PonFY0GynUorq6bK/zhgMUZC6h5ljiWE7tdEMYQlKpmC6v33 SAZ/eJot2QUxsuGqEa5lw7ev2jDdk3zaV8G1Z/dF94rYLXx2+sDWqGdGkTdwRdViylnx 3JmY16l/QsGuK0h5aAOjuucw+2fljZ6FqYwgicfTKZp5nMqLjhw9+ySPtBUxGoDJAl9g umsY7Svyi5bVHsjrDiD2O+cKjSbagtB80qyRDKCTf6Grjj1vyxbgghRhII8x7aABEd6X IuYdNSg5nALRZSM4iQTuQZRgo/4yE9bqsdSMBwNaurdAah/5dS02LIVHs5Ns9X5KHcb3 U+Pg== X-Gm-Message-State: APjAAAX4BeJTiITo9iOf0bqF93DzlMHglyc2Lb20f8qrrpsvguQZjTzk l4Uk8nOBnciYn7r0Ph1uutRyUw== X-Received: by 2002:a17:90a:3281:: with SMTP id l1mr9999852pjb.43.1573178776398; Thu, 07 Nov 2019 18:06:16 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id p3sm4846913pfb.163.2019.11.07.18.06.15 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Thu, 07 Nov 2019 18:06:15 -0800 (PST) Date: Thu, 7 Nov 2019 21:06:14 -0500 From: Joel Fernandes To: Andrew Morton 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: <20191108020614.GA99567@google.com> References: <20191107195355.80608-1-joel@joelfernandes.org> <20191107170023.0695732bb67eb80acd4caee5@linux-foundation.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191107170023.0695732bb67eb80acd4caee5@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 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). thanks, - Joel