[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130814163311.GB7208@kroah.com>
Date: Wed, 14 Aug 2013 09:33:11 -0700
From: Greg Kroah-Hartman <gregkh@...uxfoundation.org>
To: Benedikt Spranger <b.spranger@...utronix.de>
Cc: netdev@...r.kernel.org,
Alexander Frank <Alexander.Frank@...rspaecher.com>,
Sebastian Andrzej Siewior <bigeasy@...utronix.de>,
"Hans J. Koch" <hjk@...sjkoch.de>,
Holger Dengler <dengler@...utronix.de>
Subject: Re: [PATCH 1/7] uio: add module owner to prevent inappropriate
module unloading
On Wed, Aug 14, 2013 at 09:19:46AM +0200, Benedikt Spranger wrote:
> Am Tue, 13 Aug 2013 10:48:14 -0700
> schrieb Greg Kroah-Hartman <gregkh@...uxfoundation.org>:
>
> > On Tue, Aug 13, 2013 at 11:08:36AM +0200, Benedikt Spranger wrote:
> > > If an UIO device is created by another driver (MFD for instance) it has to be
> > > ensured that the MFD driver isn't removed while the UIO is still in use.
> >
> > Shouldn't if the MFD driver is removed, the UIO device will be cleaned
> > up and also removed?
> That is part of the problem:
>
> 1) MFD driver creates platform device "uio_pdrv"
> 2) uio_pdrv creates "UIOX"
> 3) userspace opens "UIOX"
> 4) MFD driver unload (remove platform device "uio_pdrv")
How can this happen in a normal situation? Modules do not simply unload
themselves :)
> 5) userspace reads from "UIOX" --> crash
Step 4 should have told UIO that it was gone and had it shut everything
down properly, so that there would not be a crash.
> > You shouldn't need a module reference for this type of thing.
> The driver uio_pdrv has no chance to recognize that the underlaying platform
> device has gone.
The mfd driver could tell it that it is gone, right?
thanks,
greg k-h
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@...r.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
Powered by blists - more mailing lists