Received: by 2002:a05:6358:9144:b0:117:f937:c515 with SMTP id r4csp1963399rwr; Fri, 21 Apr 2023 02:06:15 -0700 (PDT) X-Google-Smtp-Source: AKy350bIDu0tV8oBuHDOAKQu+qbPIdtg0NSrEPQgbEZxSn7Erb3op+DN2ftUGllVHDYsri/IjzTn X-Received: by 2002:a17:902:9688:b0:1a6:b98b:eea9 with SMTP id n8-20020a170902968800b001a6b98beea9mr3923250plp.20.1682067975405; Fri, 21 Apr 2023 02:06:15 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1682067975; cv=none; d=google.com; s=arc-20160816; b=QBHFAHneZwf0qEuPEMhzY2vfYfw90aBdJsKzBRycmC3hH6a6DGyuKXBLkQCmBUmp7f AqJthn+hyS063UbF6isXkid9uvN/ij+z4SRhTDlHY5ejBl3ZBJPM5751S9OVIKJdfttd V9VXH6kJ9nVqgK7lKixu9GeD3msLc+zJr5JP1SgGUCVgmnf5GI/vqxzNuTS91Qr+5SA3 J5lABq5Fu5QpdZRlFH7CVCMHUwebbMm0iNmeHqfxZNcw86ZcEXDhqIDh9DdIJUg9tLVP XrQShc30KoGfgQc+D600dusNDapV8h++rQ0qZxzgbJ+r6DRr3fbytkmrKvjj2Fp39FK+ i2zQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:in-reply-to:content-disposition:mime-version :references:message-id:subject:cc:to:from:date:dkim-signature :dkim-signature; bh=WNmeuisUtJOS0e4JRe3RCvMm6EO6FFE/WKAiRaEal/E=; b=a69xlIviBrAsy2irls03lolBU6dlFsATgNlPkag3s3YfpY1Y4cv6emtryvsCY54HbC ZrhBgLJ7hro8Kh8WzKA0FLjzl6z/2DkRRonsJekL4AjtRZYCQBfglz8W9OlYBhZJHzff hng5/+tXYhtBtqfDfbM8Sb+c62//QgAYvb1QmS0fllRbvuh0Ptz2jNb1qwPMcLOx7Lqf XksCHt7qha8ipHjHcCE2hplu7z9ycwDFSbsfe/7NEMuJD5l3DOpoYxz6/quH58nK7QKF GdMvJszEUu+3UlbKYh6D/bporuaVScsGyeEoOGqQ+/JkbJ6Ant8Q8x6cx3Www0YEbmn5 I16w== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="K+/pMMgM"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id a1-20020a170902710100b0019cbce63a6esi3665880pll.553.2023.04.21.02.06.01; Fri, 21 Apr 2023 02:06:15 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@suse.cz header.s=susede2_rsa header.b="K+/pMMgM"; dkim=neutral (no key) header.i=@suse.cz; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S229957AbjDUJBh (ORCPT + 99 others); Fri, 21 Apr 2023 05:01:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:49072 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S230075AbjDUJBa (ORCPT ); Fri, 21 Apr 2023 05:01:30 -0400 Received: from smtp-out1.suse.de (smtp-out1.suse.de [195.135.220.28]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id D35066181; Fri, 21 Apr 2023 02:01:28 -0700 (PDT) Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by smtp-out1.suse.de (Postfix) with ESMTPS id 87037210E6; Fri, 21 Apr 2023 09:01:27 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_rsa; t=1682067687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WNmeuisUtJOS0e4JRe3RCvMm6EO6FFE/WKAiRaEal/E=; b=K+/pMMgMT/1YH1mt+8+9/w2LZ2UD4mCFUAQ1YFU30rAC7mqVOevf8rGc8o17oPSFYr4vdz /i6m2+R4gGR/YhkSLr2womU1tMZhHX1apPj2dTsaT98wpMv/Tpfx/jxqba3JRUendTqmL1 Q2R2IT3h05b0AtMLSTKtVzNiu+44O28= DKIM-Signature: v=1; a=ed25519-sha256; c=relaxed/relaxed; d=suse.cz; s=susede2_ed25519; t=1682067687; h=from:from:reply-to:date:date:message-id:message-id:to:to:cc:cc: mime-version:mime-version:content-type:content-type: in-reply-to:in-reply-to:references:references; bh=WNmeuisUtJOS0e4JRe3RCvMm6EO6FFE/WKAiRaEal/E=; b=IT9nCn+/Ipnkil5UxQDEd2Gknx3JGzCc+mmfcxUbFGvdAp0ttwT4QpaKfbQuUdv3uX/EAQ lpd2Nhg/eOGnTYBw== Received: from imap2.suse-dmz.suse.de (imap2.suse-dmz.suse.de [192.168.254.74]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (P-521) server-digest SHA512) (No client certificate requested) by imap2.suse-dmz.suse.de (Postfix) with ESMTPS id 6F64413456; Fri, 21 Apr 2023 09:01:27 +0000 (UTC) Received: from dovecot-director2.suse.de ([192.168.254.65]) by imap2.suse-dmz.suse.de with ESMTPSA id EjYjG+dQQmQrQQAAMHmgww (envelope-from ); Fri, 21 Apr 2023 09:01:27 +0000 Received: by quack3.suse.cz (Postfix, from userid 1000) id CD5DAA0729; Fri, 21 Apr 2023 11:01:26 +0200 (CEST) Date: Fri, 21 Apr 2023 11:01:26 +0200 From: Jan Kara To: Lorenzo Stoakes Cc: linux-mm@kvack.org, linux-kernel@vger.kernel.org, linux-fsdevel@vger.kernel.org, Andrew Morton , Matthew Wilcox , Mike Kravetz , Muchun Song , Alexander Viro , Christian Brauner , Andy Lutomirski Subject: Re: [RFC PATCH 0/3] permit write-sealed memfd read-only shared mappings Message-ID: <20230421090126.tmem27kfqamkdaxo@quack3> References: MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Spam-Status: No, score=-4.4 required=5.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_MED,SPF_HELO_NONE, SPF_PASS,T_SCC_BODY_TEXT_LINE,URIBL_BLOCKED autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Hi! On Mon 03-04-23 23:28:29, Lorenzo Stoakes wrote: > This patch series is in two parts:- > > 1. Currently there are a number of places in the kernel where we assume > VM_SHARED implies that a mapping is writable. Let's be slightly less > strict and relax this restriction in the case that VM_MAYWRITE is not > set. > > This should have no noticeable impact as the lack of VM_MAYWRITE implies > that the mapping can not be made writable via mprotect() or any other > means. > > 2. Align the behaviour of F_SEAL_WRITE and F_SEAL_FUTURE_WRITE on mmap(). > The latter already clears the VM_MAYWRITE flag for a sealed read-only > mapping, we simply extend this to F_SEAL_WRITE too. > > For this to have effect, we must also invoke call_mmap() before > mapping_map_writable(). > > As this is quite a fundamental change on the assumptions around VM_SHARED > and since this causes a visible change to userland (in permitting read-only > shared mappings on F_SEAL_WRITE mappings), I am putting forward as an RFC > to see if there is anything terribly wrong with it. So what I miss in this series is what the motivation is. Is it that you need to map F_SEAL_WRITE read-only? Why? Honza -- Jan Kara SUSE Labs, CR