Received: by 2002:a05:6a10:1d13:0:0:0:0 with SMTP id pp19csp595801pxb; Thu, 19 Aug 2021 06:58:57 -0700 (PDT) X-Google-Smtp-Source: ABdhPJyUD4VWIv81ei5H6Oj1PcVLCbyBYnAs6B1r2QDj5OzNotZQ0sfcW+ePoJ2aoAyAdZvZQQqy X-Received: by 2002:a5d:9ada:: with SMTP id x26mr11325602ion.50.1629381536970; Thu, 19 Aug 2021 06:58:56 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1629381536; cv=none; d=google.com; s=arc-20160816; b=ixjZZVl8h+E2XJ3X0Wsm2r1jiWQXret0YuU7KIU1F+pImbMxQasZCe1rznbTiWqizc iI1U2yPU7trvw4LH3dTl5t+BpfZhsHLYFIYz81ARIfHaJYROHqK99GNInTaRkyJSYPmq ySD+8C3uWZ0QbPbwAGRS+NeVG9mYig+T50nPsQWxOU4DBlojiKbEd2zEAQA/JkyH8OgG UD4eUFOVsTp4pKkm+01sccU1Ce7z7f8k1UbyXv251sHDLBrR1rN78z8EuLF/ZgzPy35t ccdlzzR8+um1OVrLCA3x0Mror37Pj9iG/Ng6q+Pi0A/PVmhth9FZ6+ICdMPXoOMCDezv ICQA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:subject:content-transfer-encoding:mime-version :user-agent:message-id:in-reply-to:date:references:cc:to:from; bh=go83elSA0IPb2J5X5+bDq5Stwm67yqtm5/sc0IO4MVs=; b=aXBJ78an4lsJeX+qHwJjv6L3Fz3xIDyPkcQMX+eGrmiWaTwuNSKlajuJRRI1XHz01B 9yb4LSjCOW3V2quaGmV4IY6QFiPwA2dam9zErtz4i6zWbhVclWkmIsW9zRb0hGgr16Vp yo/UZ2PDXKMtpUstvsGkldXPVWHYJvteYSPzPqp0HDjGdzN3QRzGxcauVVIOb/nSGQex HxIIstdXC0o5nltFiXgR0KLmLRhKLN3ZS+gTQqTSHkShyV+kHzG53wEisYgMuq/q32Wv lsX0XP4+zThm68fypIy80uz6xstBlr88fRfwpHHWfgdaXZNtN1yEMOdvyE5gms0pAWy8 r7aw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id j3si3341383jak.117.2021.08.19.06.58.45; Thu, 19 Aug 2021 06:58:56 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=xmission.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S240240AbhHSN6b convert rfc822-to-8bit (ORCPT + 99 others); Thu, 19 Aug 2021 09:58:31 -0400 Received: from out01.mta.xmission.com ([166.70.13.231]:59828 "EHLO out01.mta.xmission.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S240200AbhHSN6X (ORCPT ); Thu, 19 Aug 2021 09:58:23 -0400 Received: from in02.mta.xmission.com ([166.70.13.52]:57326) by out01.mta.xmission.com with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mGiY4-000ia2-O6; Thu, 19 Aug 2021 07:57:36 -0600 Received: from ip68-227-160-95.om.om.cox.net ([68.227.160.95]:52186 helo=email.xmission.com) by in02.mta.xmission.com with esmtpsa (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.93) (envelope-from ) id 1mGiY3-00AqBr-Kq; Thu, 19 Aug 2021 07:57:36 -0600 From: ebiederm@xmission.com (Eric W. Biederman) To: bfields@fieldses.org (J. Bruce Fields) Cc: Andy Lutomirski , Linus Torvalds , David Laight , David Hildenbrand , Linux Kernel Mailing List , Andrew Morton , Thomas Gleixner , Ingo Molnar , Borislav Petkov , "H. Peter Anvin" , Al Viro , Alexey Dobriyan , Steven Rostedt , "Peter Zijlstra \(Intel\)" , Arnaldo Carvalho de Melo , Mark Rutland , Alexander Shishkin , Jiri Olsa , Namhyung Kim , Petr Mladek , Sergey Senozhatsky , Andy Shevchenko , Rasmus Villemoes , Kees Cook , Greg Ungerer , Geert Uytterhoeven , Mike Rapoport , Vlastimil Babka , Vincenzo Frascino , Chinwen Chang , Michel Lespinasse , Catalin Marinas , "Matthew Wilcox \(Oracle\)" , Huang Ying , Jann Horn , Feng Tang , Kevin Brodsky , Michael Ellerman , Shawn Anastasio , Steven Price , Nicholas Piggin , Christian Brauner , Jens Axboe , Gabriel Krisman Bertazi , Peter Xu , Suren Baghdasaryan , Shakeel Butt , Marco Elver , Daniel Jordan , Nicolas Viennot , Thomas Cedeno , Collin Fijalkovich , Michal Hocko , Miklos Szeredi , Chengguang Xu , Christian =?utf-8?Q?K=C3=B6nig?= , "linux-unionfs\@vger.kernel.org" , Linux API , the arch/x86 maintainers , "\" , Linux-MM , Florian Weimer , Michael Kerrisk References: <20210812084348.6521-1-david@redhat.com> <87o8a2d0wf.fsf@disp2133> <60db2e61-6b00-44fa-b718-e4361fcc238c@www.fastmail.com> <87lf56bllc.fsf@disp2133> <87eeay8pqx.fsf@disp2133> <5b0d7c1e73ca43ef9ce6665fec6c4d7e@AcuMS.aculab.com> <87h7ft2j68.fsf@disp2133> <20210818154217.GB24115@fieldses.org> Date: Thu, 19 Aug 2021 08:56:52 -0500 In-Reply-To: <20210818154217.GB24115@fieldses.org> (J. Bruce Fields's message of "Wed, 18 Aug 2021 11:42:17 -0400") Message-ID: <87bl5tv8pn.fsf@disp2133> User-Agent: Gnus/5.13 (Gnus v5.13) Emacs/26.1 (gnu/linux) MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8BIT X-XM-SPF: eid=1mGiY3-00AqBr-Kq;;;mid=<87bl5tv8pn.fsf@disp2133>;;;hst=in02.mta.xmission.com;;;ip=68.227.160.95;;;frm=ebiederm@xmission.com;;;spf=neutral X-XM-AID: U2FsdGVkX1+peADQdS13oBRstgvxG3nqTM38ZOsjU00= X-SA-Exim-Connect-IP: 68.227.160.95 X-SA-Exim-Mail-From: ebiederm@xmission.com X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on sa03.xmission.com X-Spam-Level: X-Spam-Status: No, score=-0.2 required=8.0 tests=ALL_TRUSTED,BAYES_50, DCC_CHECK_NEGATIVE,T_TM2_M_HEADER_IN_MSG,T_TooManySym_01, T_TooManySym_02,XM_B_Unicode autolearn=disabled version=3.4.2 X-Spam-Virus: No X-Spam-Report: * -1.0 ALL_TRUSTED Passed through trusted hosts only via SMTP * 0.8 BAYES_50 BODY: Bayes spam probability is 40 to 60% * [score: 0.5000] * 0.0 T_TM2_M_HEADER_IN_MSG BODY: No description available. * 0.0 XM_B_Unicode BODY: Testing for specific types of unicode * -0.0 DCC_CHECK_NEGATIVE Not listed in DCC * [sa03 1397; Body=1 Fuz1=1 Fuz2=1] * 0.0 T_TooManySym_02 5+ unique symbols in subject * 0.0 T_TooManySym_01 4+ unique symbols in subject X-Spam-DCC: XMission; sa03 1397; Body=1 Fuz1=1 Fuz2=1 X-Spam-Combo: ;bfields@fieldses.org (J. Bruce Fields) X-Spam-Relay-Country: X-Spam-Timing: total 496 ms - load_scoreonly_sql: 0.04 (0.0%), signal_user_changed: 4.4 (0.9%), b_tie_ro: 3.0 (0.6%), parse: 1.49 (0.3%), extract_message_metadata: 14 (2.8%), get_uri_detail_list: 1.83 (0.4%), tests_pri_-1000: 18 (3.6%), tests_pri_-950: 1.02 (0.2%), tests_pri_-900: 0.95 (0.2%), tests_pri_-90: 121 (24.4%), check_bayes: 117 (23.6%), b_tokenize: 17 (3.4%), b_tok_get_all: 12 (2.4%), b_comp_prob: 2.9 (0.6%), b_tok_touch_all: 82 (16.5%), b_finish: 0.77 (0.2%), tests_pri_0: 322 (65.0%), check_dkim_signature: 0.44 (0.1%), check_dkim_adsp: 4.5 (0.9%), poll_dns_idle: 0.12 (0.0%), tests_pri_10: 2.7 (0.5%), tests_pri_500: 7 (1.4%), rewrite_mail: 0.00 (0.0%) Subject: Re: [PATCH v1 0/7] Remove in-tree usage of MAP_DENYWRITE X-SA-Exim-Version: 4.2.1 (built Sat, 08 Feb 2020 21:53:50 +0000) X-SA-Exim-Scanned: Yes (on in02.mta.xmission.com) Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org bfields@fieldses.org (J. Bruce Fields) writes: > On Fri, Aug 13, 2021 at 05:49:19PM -0700, Andy Lutomirski wrote: >> I’ll bite. How about we attack this in the opposite direction: remove >> the deny write mechanism entirely. > > For what it's worth, Windows has open flags that allow denying read or > write opens. They also made their way into the NFSv4 protocol, but > knfsd enforces them only against other NFSv4 clients. Last I checked, > Samba attempted to emulate them using flock (and there's a comment to > that effect on the flock syscall in fs/locks.c). I don't know what Wine > does. > > Pavel Shilovsky posted flags adding O_DENY* flags years ago: > > https://lwn.net/Articles/581005/ > > I keep thinking I should look back at those some day but will probably > never get to it. > > I've no idea how Windows applications use them, though I'm told it's > common. I don't know in any detail. I just have this memory of not being able to open or do anything with a file on windows while any application has it open. We limit mandatory locks to filesystems that have the proper mount flag and files that are sgid but are not executable. Reusing that limit we could probably allow such a behavior in Linux without causing chaos. Without being very strict about which files can participate I can just imagine someone hiding their presence by not allowing other applications the ability to write to utmp or a log file. In the windows world where everything evolved with those kinds of restrictions it is probably fine (although super annoying). Eric