lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <d120d5000706270637i6d37da6eve86f65dadc5c128a@mail.gmail.com>
Date:	Wed, 27 Jun 2007 09:37:58 -0400
From:	"Dmitry Torokhov" <dmitry.torokhov@...il.com>
To:	"Greg KH" <gregkh@...e.de>
Cc:	"Dave Young" <hidave.darkstar@...il.com>,
	linux-kernel@...r.kernel.org
Subject: Re: [PATCH] atkbd: cleanup only once

On 6/27/07, Greg KH <gregkh@...e.de> wrote:
> On Wed, Jun 27, 2007 at 12:59:32AM -0400, Dmitry Torokhov wrote:
> > On Wednesday 27 June 2007 00:28, Greg KH wrote:
> > > On Wed, Jun 27, 2007 at 12:34:09AM -0400, Dmitry Torokhov wrote:
> > > > Hi Dave,
> > > >
> > > > On Wednesday 27 June 2007 06:59, Dave Young wrote:
> > > > > Hi,
> > > > >
> > > > > If you press ctrl+alt+del several times as kernel booting (before user level bootin), the kernel will oops. I found the ps2_command is called more than once, then the ps2dev->serio maybe NULL pointer.
> > > > >
> > > > > 2.6.22-rc5 and 2.6.22-rc6 have same result.
> > > > >
> > > > > Signed-off-by: Dave Young <hidave.darkstar@...il.com>
> > > > > ---
> > > > > diff -upr linux/drivers/input/keyboard/atkbd.c linux.new/drivers/input/keyboard/atkbd.c
> > > > > --- linux/drivers/input/keyboard/atkbd.c        2007-06-27 10:38:37.000000000 +0000
> > > > > +++ linux.new/drivers/input/keyboard/atkbd.c    2007-06-27 10:37:39.000000000 +0000
> > > > > @@ -795,6 +795,11 @@ static int atkbd_activate(struct atkbd *
> > > > >
> > > > >  static void atkbd_cleanup(struct serio *serio)
> > > > >  {
> > > > > +       static int flag;
> > > > > +
> > > > > +       if(flag)
> > > > > +               return;
> > > > > +       flag = 1;
> > > >
> > > > Unfortunately this will prevent atkbd from resetting keyboard on 2nd
> > > > suspend attempt. It will also not work if you have an active MUX and
> > > > have a couple of keyboards connected.
> > > >
> > > > Greg, now that you removed rwsem from subsystem (and subsystem itself
> > > > for that matter) there is nothing as far as I can see that stops
> > > > several threads from running device_shutdown() simultaneously. I also
> > > > do not see what would isolate device probing and shutting them down
> > > > at the same time. Am I missing something?
> > >
> > > There was never anything stopping that from happening before.  No driver
> > > core code was using that rwsem, so it wasn't protecting anything,
> > > despite people trying to use it as if it was :)
> > >
> >
> > It did protect device_shutdown() from itself, didn't it?
>
> Hm, yeah, it did, but that was it.  If that was its goal, it sure wasn't
> obvious at all.
>
> Do you think the driver core needs to serialize this?
>

I think that we need to have device tree (or rather list) stable while
we performing system-wide state transitions, such as shutdown.
Otheriwse if device_shutdown runs simultaneously with device discovery
and new devices get added to the list we risk leaving them (and
potentially thier parents) running. I think we had something like that
before klist conversion - kobject_add was taking device_subsys.rwsem.
However there are dangers if some device goes offline on its own right
in the middle of shutdown process and bus code deadlocks... Maybe we
only need to disable adding new devices in suspend/shutdown path while
allowing removal... I am not sure.

Overall there is lack of consistent locking in suspend/shutdown area:
shutdown interface uses BKL, suspend (swsusp et all) uses pm_mutex and
C_A_D handler does not have any locking at all at the moment.

> thanks,
>
> greg k-h
>


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

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ