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: <20150614142834.GA3069@light.dominikbrodowski.net>
Date:	Sun, 14 Jun 2015 16:28:34 +0200
From:	Dominik Brodowski <linux@...inikbrodowski.net>
To:	Takeshi Yoshimura <yos@...ab.ics.keio.ac.jp>
Cc:	Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
	Vaishali Thakkar <vthakkar1994@...il.com>,
	linux-pcmcia@...ts.infradead.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH 1/1] pcmcia: Add missing free_irq()

Hi Takeshi,

On Sun, Jun 14, 2015 at 09:14:41PM +0900, Takeshi Yoshimura wrote:
> In yenta_probe(), an irq leak potentially happens when
> pcmcia_register_socket() fails. I added the missed call.

nice catch, many thanks.

> index 965bd84..7922e30f 100644
> --- a/drivers/pcmcia/yenta_socket.c
> +++ b/drivers/pcmcia/yenta_socket.c
> @@ -1269,6 +1269,8 @@ static int yenta_probe(struct pci_dev *dev, const struct pci_device_id *id)
>  		pcmcia_unregister_socket(&socket->socket);
>  	}
>  
> +	if (socket->cb_irq)
> +		free_irq(socket->irq, socket);
>   unmap:
>  	iounmap(socket->base);
>   release:


However, this should also handle the case for sock->cb_irq being zero,
like it is done in yenta_close.

Furthermore, when comparing yenta_close and this error path in yenta_probe(),
I noticed a few other issues:
- yenta_free_resources() is not called in yenta_probe()
- pci_set_drvdata(dev, NULL) and kfree(socket) are not called in yenta_probe()
- sock->base is always set to non-NULL when yenta_close() is called,
  therefore the check in yenta_close() may be removed.

Would you be willing to update your patch to address also these issues?
Then, I'll happily push it upstream.

Best,
	Dominik

Download attachment "signature.asc" of type "application/pgp-signature" (820 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ