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 8FC9BC5DF60 for ; Fri, 8 Nov 2019 15:35:48 +0000 (UTC) Received: from kanga.kvack.org (kanga.kvack.org [205.233.56.17]) by mail.kernel.org (Postfix) with ESMTP id 52FCC222CF for ; Fri, 8 Nov 2019 15:35:48 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (1024-bit key) header.d=joelfernandes.org header.i=@joelfernandes.org header.b="vorgUDj6" DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 52FCC222CF 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 E392D6B0007; Fri, 8 Nov 2019 10:35:47 -0500 (EST) Received: by kanga.kvack.org (Postfix, from userid 40) id DE9426B0008; Fri, 8 Nov 2019 10:35:47 -0500 (EST) X-Delivered-To: int-list-linux-mm@kvack.org Received: by kanga.kvack.org (Postfix, from userid 63042) id D27436B000A; Fri, 8 Nov 2019 10:35:47 -0500 (EST) X-Delivered-To: linux-mm@kvack.org Received: from forelay.hostedemail.com (smtprelay0049.hostedemail.com [216.40.44.49]) by kanga.kvack.org (Postfix) with ESMTP id BC7F76B0007 for ; Fri, 8 Nov 2019 10:35:47 -0500 (EST) Received: from smtpin20.hostedemail.com (10.5.19.251.rfc1918.com [10.5.19.251]) by forelay05.hostedemail.com (Postfix) with SMTP id 6455A181AEF1A for ; Fri, 8 Nov 2019 15:35:47 +0000 (UTC) X-FDA: 76133510334.20.hands87_3274a7a09f00d X-HE-Tag: hands87_3274a7a09f00d X-Filterd-Recvd-Size: 3749 Received: from mail-pg1-f196.google.com (mail-pg1-f196.google.com [209.85.215.196]) by imf05.hostedemail.com (Postfix) with ESMTP for ; Fri, 8 Nov 2019 15:35:46 +0000 (UTC) Received: by mail-pg1-f196.google.com with SMTP id w11so4154181pga.12 for ; Fri, 08 Nov 2019 07:35:46 -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=mbqjUWGDXWIaVy6iV3sdofZ0jxt/pVLpoh92ATrPX1Y=; b=vorgUDj6+6UmJsxUwlznw94CFZybpHAl2ne3wb2WfWG1z8CgLHiINfPY04JeSC+0k1 /1ztuPLxGB1SErJB1Qvk844TfucGzjQjyH+5c+Ilc4DHUnYlFCfSYrjWcXtv6P6NNdKd I3tYRrSpNfjKot7F5PnRxv/1pPMmbNhi533jw= 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=mbqjUWGDXWIaVy6iV3sdofZ0jxt/pVLpoh92ATrPX1Y=; b=FLbneKkM3RDc0WvrzmY/agn0LvNpaLirFXmkOx6T9KmhKAaWYblOtrTLjgolhwxd0P J0noxuoRYUCfr/9H2t64SFhqejRWLhQ0C+qd7azxoIXKZj9Tgg2PT2CLpuCS5CXbhM74 WdYtlOTO4y9oQnifTwnQ7LD0PNO87a9QUKZ0nA9LKgOLsmJHcvZgTLB7cSI2BWZh6R8W wkO7TWY8T1OW2rtJut/aAi9gE/hrtCQBnpzN797aDzX501kqfyBbZqBKVlQipanINkUQ 5PnOgMMwkPo71vrqoECYcCetDnETcYWcUjXOUzJfu2uyezWiphX1lfmf44O8+JPnHEz4 1W5A== X-Gm-Message-State: APjAAAXuhfqaqNlbzgwNmZlkpo0YgzY4jC7oDWl0Rny8JuY8bre82Wfd n/6eDlwqECzG77t3fSeLojqDsA== X-Google-Smtp-Source: APXvYqwb/aQ3D7gYofOFDmeLVdI6s94UZkNaBx0GgMxCmDj+wJ0R0I6NwdU1Nlz6L3VGQ3sxGI1pxw== X-Received: by 2002:a62:d44b:: with SMTP id u11mr12485806pfl.259.1573227345330; Fri, 08 Nov 2019 07:35:45 -0800 (PST) Received: from localhost ([2620:15c:6:12:9c46:e0da:efbf:69cc]) by smtp.gmail.com with ESMTPSA id j7sm5528054pgl.38.2019.11.08.07.35.44 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 08 Nov 2019 07:35:44 -0800 (PST) Date: Fri, 8 Nov 2019 10:35:43 -0500 From: Joel Fernandes To: Christoph Hellwig Cc: linux-kernel@vger.kernel.org, Nicolas Geoffray , kernel-team@android.com, Andrew Morton , 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: <20191108153543.GC99567@google.com> References: <20191107195355.80608-1-joel@joelfernandes.org> <20191108063308.GB18778@infradead.org> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: <20191108063308.GB18778@infradead.org> User-Agent: Mutt/1.10.1 (2018-07-13) X-Bogosity: Ham, tests=bogofilter, spamicity=0.000001, 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 10:33:08PM -0800, Christoph Hellwig wrote: > > - * Since the F_SEAL_FUTURE_WRITE seals allow for a MAP_SHARED > > - * read-only mapping, take care to not allow mprotect to revert > > - * protections. > > + * Since an F_SEAL_FUTURE_WRITE sealed memfd can be mapped as > > + * MAP_SHARED and read-only, take care to not allow mprotect to > > + * revert protections on such mappings. Do this only for shared > > + * mappings. For private mappings, don't need to mask VM_MAYWRITE > > This adds an > 80 char line. Oh, true. Sorry. Andrew I hate to ask you but since you took the patch already, could you just the comment for the character limit in the one you applied? thanks, - Joel