Received: by 2002:a05:6a10:413:0:0:0:0 with SMTP id 19csp1911906pxp; Sun, 13 Mar 2022 04:01:33 -0700 (PDT) X-Google-Smtp-Source: ABdhPJx0RuNRmv6fFezvRqiBFJ5FTmlB6R52XsPOnpCPBsN5KTjGVUZrIImfnCYDTrzjveKKOz6f X-Received: by 2002:a17:906:2ec9:b0:6db:1bfc:9c27 with SMTP id s9-20020a1709062ec900b006db1bfc9c27mr15428019eji.505.1647169293609; Sun, 13 Mar 2022 04:01:33 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1647169293; cv=none; d=google.com; s=arc-20160816; b=ys4vKJkvux7oxBSMiKtx5p/cMspe3MQ/W+SvB4BPH/CNlmsjchaQNIooiVRMdvSEt2 ruUhrticjSwN/J8lCnTV80Rf1sc6MJEIRtCpGmYIb9VQwtVtpVTZc/BNaQtd0rxJc2ti YPBSw9uIulUs/LP3sOcJe7CowKABSQC75KeBx7yjl5SnT7gZb2rAbsjdogQ4ikpqJ9Vo cO8WJbqLonvHYb2Fe6QUBzRXlyuTViH5hEkTJRJjq6Me2616xfKzVlTNboa5wFjuAuo1 apeoTLaKNxRnoK/UFAtdkeXWngAQHFB17E/ZRRtR8ry40aHedWMOpLpBy9eWNGQVGE9S q84w== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:sender:in-reply-to:content-disposition :mime-version:references:message-id:subject:cc:to:from:date; bh=GqRmD2Eg3KfXC3h3ADoErXODKHAZLPPbVTzvm9pejz0=; b=OdF5/hZMOWx9rC45HCUU9uWCAbluZdmG4I8S9Cx4PqcjBYOKeIjtyiOsfprudT9fVK AsvT1pU+O/RKfzLIxAhJcoch2q1KrhDRVCRaUmsqBED03+7YKjkInlptti0j+8bnZwpD EP0sehyV5YNFwRpHsp8cHOWxxIGSVcWg1hjE8VlSDFa+DsHOvoEFb5JAoYVHHMNnCTsd PA3iDIpVyrWsCUkbZsXsIgzWNN+NchGUg6hhhxTiydhxesmafjLluDB8EAPTM7IVAgwz 89yaWCiHRPj5B5dhlwgGJeavZoWUZd1TU/cwMkH32bp8cGZ5lUIbd1VvKObuDH4Sh9fL bDWg== ARC-Authentication-Results: i=1; mx.google.com; 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 l1-20020a17090612c100b006cfcd25c5a2si7404053ejb.897.2022.03.13.04.01.08; Sun, 13 Mar 2022 04:01:33 -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; 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 S233252AbiCMAoT (ORCPT + 99 others); Sat, 12 Mar 2022 19:44:19 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:42260 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232841AbiCMAoS (ORCPT ); Sat, 12 Mar 2022 19:44:18 -0500 Received: from zeniv-ca.linux.org.uk (zeniv-ca.linux.org.uk [IPv6:2607:5300:60:148a::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id F3AAA10FCB; Sat, 12 Mar 2022 16:43:10 -0800 (PST) Received: from viro by zeniv-ca.linux.org.uk with local (Exim 4.94.2 #2 (Red Hat Linux)) id 1nTCJk-00ATSa-Ff; Sun, 13 Mar 2022 00:42:40 +0000 Date: Sun, 13 Mar 2022 00:42:40 +0000 From: Al Viro To: Paul Moore Cc: John Johansen , =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , Christian Brauner , "Darrick J . Wong" , Eric Paris , James Morris , Kentaro Takeda , Miklos Szeredi , "Serge E . Hallyn" , Stephen Smalley , Steve French , Tetsuo Handa , linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org, linux-security-module@vger.kernel.org, =?iso-8859-1?Q?Micka=EBl_Sala=FCn?= , selinux@vger.kernel.org, Casey Schaufler Subject: Re: [PATCH v1] fs: Fix inconsistent f_mode Message-ID: References: <20220228215935.748017-1-mic@digikod.net> <20220301092232.wh7m3fxbe7hyxmcu@wittgenstein> <8d520529-4d3e-4874-f359-0ead9207cead@canonical.com> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: Sender: Al Viro X-Spam-Status: No, score=-4.2 required=5.0 tests=BAYES_00,RCVD_IN_DNSWL_MED, SPF_HELO_NONE,SPF_NONE,T_SCC_BODY_TEXT_LINE 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 On Fri, Mar 11, 2022 at 05:15:01PM -0500, Paul Moore wrote: > The silence on this has been deafening :/ No thoughts on fixing, or > not fixing OPEN_FMODE(), Al? > > At this point I have to assume OPEN_FMODE() isn't changing so I'm > going to go ahead with moving SELinux over to file::f_flags. Once > I've got something working I'll CC the LSM list on the patches in case > the other LSMs want to do something similar. Full disclosure, that > might not happen until early-to-mid next week due to the weekend, new > kernel expected on Sunday, etc. ENOBUG. The primary user of that is fdutils; they wanted to be able to issue ioctls on a floppy disk drive, with no disk inserted. Or with a disk that has weird formatting (as the matter of fact, some of those ioctls are precisely "use such-and-such weird format"). A cleaner solution would be to have a separate device node (or sysfs file, or...) for that kind of OOB stuff. However, that's not how it had been done way back when, and we are stuck with the existing ABI. Namely, "have the lower two bits of flags both set" for "open for ioctls only; require MAY_READ|MAY_WRITE on device node, allow neither read() nor write() on that descriptor". I'm not sure if anyone _uses_ fdutils these days. OTOH, you never know what kind of weird setups gets used, and qemu has floppy emulation, so we can't even go for "no floppy drive is going to be in working condition nowadays". So I'm afraid that this ABI is going to stay ;-/ It's a long-standing wart, from at least '94 if not earlier, it's documented (open(2)) and it's used by a package that is shipped at least by debian and ubuntu. And it's certainly *not* the kind of code anyone sane would want to migrate to a replacement ABI, no matter how nice - look through the list of utilities in there and imagine what the testing for regressions would feel like.