linux-kernel.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Al Viro <viro@ZenIV.linux.org.uk>
To: Eric Paris <eparis@redhat.com>
Cc: linux-kernel@vger.kernel.org, alan <alan@redhat.com>,
	aviro@redhat.com, drepper@redhat.com, hch@infradead.org,
	sds@tycho.nsa.gov, jmorris@namei.org
Subject: Re: [RFC] correct flags to f_mode conversion in __dentry_open
Date: Wed, 12 Mar 2008 18:34:41 +0000	[thread overview]
Message-ID: <20080312183441.GJ27894@ZenIV.linux.org.uk> (raw)
In-Reply-To: <1205346327.5297.232.camel@localhost.localdomain>

On Wed, Mar 12, 2008 at 02:25:27PM -0400, Eric Paris wrote:
> I recently tried to add an SELinux BUG_ON in the case where the kernel
> made a permission request for no permissions and was able to stumble
> over it with something as simple as
> 
> open("/dev/null", 3);
> 
> Notice that 3 == (O_RDWR | O_WRONLY)
> 
> First question, is 3 ever a valid flag from from userspace to sys_open?

Yes.  "Check for both read and write permissions, set neither FMODE_READ
nor FMODE_WRITE".

Don't break drivers, please - some use that for "ioctl-only" opens,
with special semantics for those.

  reply	other threads:[~2008-03-12 18:34 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2008-03-12 18:25 [RFC] correct flags to f_mode conversion in __dentry_open Eric Paris
2008-03-12 18:34 ` Al Viro [this message]
2008-03-12 18:41   ` Eric Paris
2008-03-12 18:47 ` Andreas Schwab
2008-03-15 21:59 ` Alan Cox
2008-03-15 22:00   ` Alexander Viro
2008-03-17 10:45   ` Christoph Hellwig
2008-05-21 17:54     ` Michael Kerrisk
2008-05-22  2:10       ` James Morris

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=20080312183441.GJ27894@ZenIV.linux.org.uk \
    --to=viro@zeniv.linux.org.uk \
    --cc=alan@redhat.com \
    --cc=aviro@redhat.com \
    --cc=drepper@redhat.com \
    --cc=eparis@redhat.com \
    --cc=hch@infradead.org \
    --cc=jmorris@namei.org \
    --cc=linux-kernel@vger.kernel.org \
    --cc=sds@tycho.nsa.gov \
    /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;
as well as URLs for NNTP newsgroup(s).