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: <557A7CCA.3080406@suse.de>
Date:	Fri, 12 Jun 2015 08:31:38 +0200
From:	Hannes Reinecke <hare@...e.de>
To:	Johannes Thumshirn <jthumshirn@...e.de>,
	"James E.J. Bottomley" <JBottomley@...n.com>
CC:	Christoph Hellwig <hch@....de>,
	Mike Christie <michaelc@...wisc.edu>,
	"Martin K. Petersen" <martin.petersen@...cle.com>,
	Bart Van Assche <bvanassche@....org>,
	Ben Hutchings <ben@...adent.org.uk>,
	linux-scsi@...r.kernel.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] mvsas: always iounmap resources

On 05/22/2015 11:15 AM, Johannes Thumshirn wrote:
> In case pci_resource_start() or pci_resource_len() reutrn 0, mvsas_ioremap
> returns without doing an iounmap() of mvi->regs_ex.
> 
> Found by the cocinelle tool.
> 
> Signed-off-by: Johannes Thumshirn <jthumshirn@...e.de>
> ---
>  drivers/scsi/mvsas/mv_init.c | 5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/scsi/mvsas/mv_init.c b/drivers/scsi/mvsas/mv_init.c
> index 53030b0..04a3205 100644
> --- a/drivers/scsi/mvsas/mv_init.c
> +++ b/drivers/scsi/mvsas/mv_init.c
> @@ -339,8 +339,11 @@ int mvs_ioremap(struct mvs_info *mvi, int bar, int bar_ex)
>  
>  	res_start = pci_resource_start(pdev, bar);
>  	res_len = pci_resource_len(pdev, bar);
> -	if (!res_start || !res_len)
> +	if (!res_start || !res_len) {
> +		iounmap(mvi->regs_ex);
> +		mvi->regs_ex = NULL;
>  		goto err_out;
> +	}
>  
>  	res_flag = pci_resource_flags(pdev, bar);
>  	if (res_flag & IORESOURCE_CACHEABLE)
> 
Reviewed-by: Hannes Reinecke <hare@...e.de>

Cheers,

Hannes
-- 
Dr. Hannes Reinecke		               zSeries & Storage
hare@...e.de			               +49 911 74053 688
SUSE LINUX GmbH, Maxfeldstr. 5, 90409 Nürnberg
GF: F. Imendörffer, J. Smithard, J. Guild, D. Upmanyu, G. Norton
HRB 21284 (AG Nürnberg)
--
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