Linux Security Modules development
 help / color / mirror / Atom feed
From: Al Viro <viro@zeniv.linux.org.uk>
To: Paul Moore <paul@paul-moore.com>
Cc: "John Johansen" <john.johansen@canonical.com>,
	"Mickaël Salaün" <mic@digikod.net>,
	"Christian Brauner" <brauner@kernel.org>,
	"Darrick J . Wong" <djwong@kernel.org>,
	"Eric Paris" <eparis@parisplace.org>,
	"James Morris" <jmorris@namei.org>,
	"Kentaro Takeda" <takedakn@nttdata.co.jp>,
	"Miklos Szeredi" <miklos@szeredi.hu>,
	"Serge E . Hallyn" <serge@hallyn.com>,
	"Stephen Smalley" <stephen.smalley.work@gmail.com>,
	"Steve French" <sfrench@samba.org>,
	"Tetsuo Handa" <penguin-kernel@i-love.sakura.ne.jp>,
	linux-fsdevel@vger.kernel.org, linux-kernel@vger.kernel.org,
	linux-security-module@vger.kernel.org,
	"Mickaël Salaün" <mic@linux.microsoft.com>,
	selinux@vger.kernel.org,
	"Casey Schaufler" <casey@schaufler-ca.com>
Subject: Re: [PATCH v1] fs: Fix inconsistent f_mode
Date: Sun, 13 Mar 2022 00:42:40 +0000	[thread overview]
Message-ID: <Yi0+AMVrzoujuMlm@zeniv-ca.linux.org.uk> (raw)
In-Reply-To: <CAHC9VhRrjqe1AdZYtjpzLJyBF6FTeQ4EcEwsOd2YMimA5_tzEA@mail.gmail.com>

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.

      parent reply	other threads:[~2022-03-13  0:43 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-02-28 21:59 [PATCH v1] fs: Fix inconsistent f_mode Mickaël Salaün
2022-03-01  9:22 ` Christian Brauner
2022-03-01 10:15   ` Mickaël Salaün
2022-03-09 21:31     ` Paul Moore
2022-03-10  0:36       ` John Johansen
2022-03-11 22:15         ` Paul Moore
2022-03-12  1:34           ` Tetsuo Handa
2022-03-12 15:17             ` Paul Moore
2022-03-14  8:22               ` Mickaël Salaün
2022-03-13  0:44             ` Al Viro
2022-03-13  0:42           ` Al Viro [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Yi0+AMVrzoujuMlm@zeniv-ca.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=brauner@kernel.org \
    --cc=casey@schaufler-ca.com \
    --cc=djwong@kernel.org \
    --cc=eparis@parisplace.org \
    --cc=jmorris@namei.org \
    --cc=john.johansen@canonical.com \
    --cc=linux-fsdevel@vger.kernel.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-security-module@vger.kernel.org \
    --cc=mic@digikod.net \
    --cc=mic@linux.microsoft.com \
    --cc=miklos@szeredi.hu \
    --cc=paul@paul-moore.com \
    --cc=penguin-kernel@i-love.sakura.ne.jp \
    --cc=selinux@vger.kernel.org \
    --cc=serge@hallyn.com \
    --cc=sfrench@samba.org \
    --cc=stephen.smalley.work@gmail.com \
    --cc=takedakn@nttdata.co.jp \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox