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] [day] [month] [year] [list]
Date:	Thu, 10 Feb 2011 23:40:27 +0100
From:	Peter Hüwe <PeterHuewe@....de>
To:	minyard@....org
Cc:	Linux Kernel <linux-kernel@...r.kernel.org>,
	Linux Torvalds <torvalds@...ux-foundation.org>,
	stable@...nel.org, openipmi-developer@...ts.sourceforge.net,
	Randy Dunlap <randy.dunlap@...cle.com>
Subject: Re: [PATCH] char/ipmi: fix OOPS caused by pnp_unregister_driver on unregistered driver

Am Donnerstag 10 Februar 2011, 23:08:38 schrieb Corey Minyard:
> This patch fixes an OOPS triggered when calling modprobe ipmi_si a
> second time after the first modprobe returned without finding any ipmi
> devices.  This can happen if you reload the module after having the
> first module load fail.  The driver was not deregistering from
> PNP in that case.
> 
> Peter Huewe originally reported this patch and supplied a fix, I have
> a different patch based on Linus' suggestion that cleans things up a
> bit more.
> 
> KernelVersion: 2.6.37
> Cc: <stable@...nel.org>
> Cc: <openipmi-developer@...ts.sourceforge.net>
> Cc: Peter Huewe <peterhuewe@....de>
> Cc: Randy Dunlap <randy.dunlap@...cle.com>
> Signed-off-by: Corey Minyard <cminyard@...sta.com>
> ---
>  drivers/char/ipmi/ipmi_si_intf.c |   12 ++----------
>  1 files changed, 2 insertions(+), 10 deletions(-)
> 
> diff --git a/drivers/char/ipmi/ipmi_si_intf.c
> b/drivers/char/ipmi/ipmi_si_intf.c index b6ae6e9..7855f9f 100644
> --- a/drivers/char/ipmi/ipmi_si_intf.c
> +++ b/drivers/char/ipmi/ipmi_si_intf.c
> @@ -320,6 +320,7 @@ static int unload_when_empty = 1;
>  static int add_smi(struct smi_info *smi);
>  static int try_smi_init(struct smi_info *smi);
>  static void cleanup_one_si(struct smi_info *to_clean);
> +static void cleanup_ipmi_si(void);
> 
>  static ATOMIC_NOTIFIER_HEAD(xaction_notifier_list);
>  static int register_xaction_notifier(struct notifier_block *nb)
> @@ -3450,16 +3451,7 @@ static int __devinit init_ipmi_si(void)
>  	mutex_lock(&smi_infos_lock);
>  	if (unload_when_empty && list_empty(&smi_infos)) {
>  		mutex_unlock(&smi_infos_lock);
> -#ifdef CONFIG_PCI
> -		if (pci_registered)
> -			pci_unregister_driver(&ipmi_pci_driver);
> -#endif
> -
> -#ifdef CONFIG_PPC_OF
> -		if (of_registered)
> -			of_unregister_platform_driver(&ipmi_of_platform_driver);
> -#endif
> -		driver_unregister(&ipmi_driver.driver);
> +		cleanup_ipmi_si();
>  		printk(KERN_WARNING PFX
>  		       "Unable to find any System Interface(s)\n");
>  		return -ENODEV;

Looks good to me - thanks.

Reviewed-by: Peter Huewe <peterhuewe@....de>
--
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