From: Matt Helsley on
On Sun, Feb 14, 2010 at 03:52:05AM +0000, Al Viro wrote:
> On Sat, Feb 13, 2010 at 04:27:43PM -0800, Matt Helsley wrote:
> > anon_inode interfaces often do not support flags that can be set
> > by fcntl(). Right now using fcntl() to set these flags falsely
> > reports success for things like O_ASYNC yet SIGIO is not delivered.
> >
> > I relied on the flags allowed by the syscalls that create
> > these files to determine the flags that are allowed to be set by
> > fcntl().
> >
> > Each patch checks flags for one anonymous inode interface:
> >
> > [PATCH 1/4] signalfd
> > [PATCH 2/4] timerfd
> > [PATCH 3/4] epoll
> > [PATCH 4/4] eventfd
> >
> > I did not check the perf, kvm-vm, or kvm-vcpu uses of anon_inodes.
>
> Er... O_ASYNC is silently ignored for regular files as well, so any
> userland code that tries to rely on fcntl() rejecting it is and always
> had been badly b0rken.

Of course. Did you mean to imply that the kernel shouldn't bother to
reject these, or were you merely making an observation?

Cheers,
-Matt Helsley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/
From: Matt Helsley on
On Mon, Feb 15, 2010 at 07:57:28PM +0000, Al Viro wrote:
> On Mon, Feb 15, 2010 at 09:26:35AM -0800, Matt Helsley wrote:
> > > > [PATCH 1/4] signalfd
> > > > [PATCH 2/4] timerfd
> > > > [PATCH 3/4] epoll
> > > > [PATCH 4/4] eventfd
> > > >
> > > > I did not check the perf, kvm-vm, or kvm-vcpu uses of anon_inodes.
> > >
> > > Er... O_ASYNC is silently ignored for regular files as well, so any
> > > userland code that tries to rely on fcntl() rejecting it is and always
> > > had been badly b0rken.
> >
> > Of course. Did you mean to imply that the kernel shouldn't bother to
> > reject these, or were you merely making an observation?
>
> I'm wondering why should we start changing that behaviour and what makes
> these 4 cases special?

I'm not saying we should change behavior for regular files. We should check
these because they're already being checked inside the special syscalls that
open these files. Without these patches fcntl(F_SETFL) is a way around those
checks for these interfaces.

Cheers,
-Matt Helsley
--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo(a)vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/