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 Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id C3439C433F5 for ; Sun, 13 Mar 2022 00:43:14 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233242AbiCMAoT (ORCPT ); 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 Precedence: bulk List-ID: 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.