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 5F5FCC5DF61 for ; Fri, 8 Nov 2019 02:06:19 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 23A1D2084C for ; Fri, 8 Nov 2019 02:06:19 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="uUZbZSTp" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 23A1D2084C 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 B688D6B0007; Thu, 7 Nov 2019 21:06:18 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id B190D6B0008; Thu, 7 Nov 2019 21:06:18 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id A2DF56B000A; Thu, 7 Nov 2019 21:06:18 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0247.hostedemail.com [216.40.44.247]) by kanga.kvack.org (Postfix) with ESMTP id 8E2906B0007 for ; Thu, 7 Nov 2019 21:06:18 -0500 (EST) Received: from smtpin07.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay03.hostedemail.com (Postfix) with SMTP id 584D58249980 for ; Fri, 8 Nov 2019 02:06:18 +0000 (UTC) X-FDA: 76131470436.07.ocean15_7133e958c0d53 X-HE-Tag: ocean15_7133e958c0d53 X-Filterd-Recvd-Size: 3957 Received: from mail-pl1-f193.google.com (mail-pl1-f193.google.com [209.85.214.193]) by imf45.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 Nov 2019 02:06:17 +0000 (UTC) Received: by mail-pl1-f193.google.com with SMTP id d29so2943141plj.8 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=FjLgZkN82JG0PQYknQlx2PnJb31HZuHGTY2DpsyETeb3P1Teej30DslyzhBoZjCoRi Gs7bRSdr6tQJW1A7yOGSVTMc/FvlmQ4Y6I2HNZWCvmyvPYqcKgQLp8Uf/W4b/dDnf8K1 ZyvR2t75gnKHniF0e+gyl1T0/p66q3duNmu1/U9hPNob4j8zbOMcPoJNWcUivzjvHymd /9DRZLjVuDq8a3t0B00eRUv0tqf+/qak/kMBWOb8A6N6k40pKxJlzGEj0LgDCiFygAHr gpXM5GDpbuwIkVTHWk2HGZBFH3FMnVNTdRNxqfCs1krVzu9/3tsyArv8dBCf1/wQbiQ2 Pdig== X-Gm-Message-State: APjAAAWthVlE1/UxBLo2aH1qUrLPL/Tnm61Cthh8rgiVsId3rLOda9So KvoaMYIk+vyokvBHCydNQW9+Jw== X-Google-Smtp-Source: APXvYqzkaUADYo9WHWLx3wLlN7f1AHNdmQF1IptwXglLCWu+FofvB9G8cJhnDv0ifrd1RUFPPxwZZA== 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) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000002, version=1.2.4 Sender: owner-linux-mm@kvack.org Precedence: bulk X-Loop: owner-majordomo@kvack.org List-ID: 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