Re: [PATCH] vt: kill tty->count usage (v2)

From: Alan Cox
Date: Tue Aug 19 2008 - 08:56:45 EST


On Mon, 18 Aug 2008 17:04:14 -0400
Aristeu Rozanski <aris@xxxxxxxxxx> wrote:

> Hi Alan,
> > > The commit e0426e6a09954d205da2d674a3d368d2715e3afd fixes a real race but
> > > still isn't enough to prevent these:
> > >
> > > kobject_add_internal failed for vcs7 with -EEXIST, don't try to register
> > > things with the same name in the same direc.
> >
> > Patch dropped due to testing failures.
> >
> > Boot to run level 3, log in and type "reboot\n". Wait
> >
> > Spews vt->driver_data == NULL warnings and oopses
> do you mind posting the logs somewhere? I wasn't able to reproduce it here so
> far.

I had a quick look and there are some obvious races from the change

You don't seem to have any locking between a hangup occuring at the same
time as say an ioctl. The f_ops change means no further calls will be
made to the console code but *not* that current ones won't continue.

Most of the time tty->driver_data is internally protected and checked by
the console_sem but not always. In particular your changes are showing up
corner cases in do_con_write and in the tty ioctl code.



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