lkml.org 
[lkml]   [2008]   [Mar]   [15]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
Date
From
SubjectRe: [RFC] correct flags to f_mode conversion in __dentry_open
On Sat, Mar 15, 2008 at 05:59:52PM -0400, Alan Cox wrote:
> 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.
>
> > does 11 really mean and should it really always be mapped to (FMODE_READ
> > | FMODE_WRITE) or should it continue to get mapped to 'no permission?'
>
> We've always mapped 3 to "no permission" to read or write. It's a linuxism

Note that we *do* request MAY_READ|MAY_WRITE; "no permission" part is
about what you can do to resulting descriptor afterwards.


\
 
 \ /
  Last update: 2008-03-15 23:03    [W:1.873 / U:0.004 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site