From: Neil Horman <nhorman@tuxdriver.com>
To: Greg KH <greg@kroah.com>
Cc: linux-pci@vger.kernel.org, linux-kernel@vger.kernel.org,
akpm@linux-foundation.org
Subject: Re: [PATCH] ibmphp: Fix module ref count underflow
Date: Wed, 10 Dec 2008 20:28:34 -0500 [thread overview]
Message-ID: <20081211012834.GA3262@localhost.localdomain> (raw)
In-Reply-To: <20081210222812.GA1513@kroah.com>
On Wed, Dec 10, 2008 at 02:28:12PM -0800, Greg KH wrote:
> On Wed, Dec 10, 2008 at 02:43:34PM -0500, Neil Horman wrote:
> > Hey-
> > I happened to notice that the ibmphp hotplug driver does something
> > rather silly in its init routine. It purposely calls module_put so as to
> > underflow its module ref count to avoid being removed from the kernel. This is
> > bad practice, and wrong, since it provides a window for subsequent module_gets
> > to reset the refcount to zero, allowing an unload to race in and cause all sorts
> > of mysterious panics. If the module is unsafe to load, it should inform the
> > kernel as such with a call to __unsafe. The patch below does that.
> >
> > Regards
> > Neil
> >
> > Signed-off-by: Neil Horman <nhorman@tuxdriver.com>
>
> Jesse is the PCI maintainer now, you should send this to him to verify
> that it goes in.
>
> Feel free to add my:
> Acked-by: Greg Kroah-Hartman <gregkh@suse.de>
>
> to this, nice job.
>
Thanks! I've forwarded the patch on to Jesse.
Best
Neil
> thanks,
>
> greg k-h
> --
> To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
> the body of a message to majordomo@vger.kernel.org
> More majordomo info at http://vger.kernel.org/majordomo-info.html
> Please read the FAQ at http://www.tux.org/lkml/
>
next prev parent reply other threads:[~2008-12-11 1:30 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2008-12-10 19:43 [PATCH] ibmphp: Fix module ref count underflow Neil Horman
2008-12-10 22:28 ` Greg KH
2008-12-11 1:28 ` Neil Horman [this message]
2008-12-16 18:42 ` Jesse Barnes
2008-12-16 19:56 ` Neil Horman
2008-12-16 20:52 ` Jesse Barnes
2008-12-17 1:13 ` Neil Horman
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20081211012834.GA3262@localhost.localdomain \
--to=nhorman@tuxdriver.com \
--cc=akpm@linux-foundation.org \
--cc=greg@kroah.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-pci@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox