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]
Message-ID: <20091103170540.GH8981@atomide.com>
Date:	Tue, 3 Nov 2009 09:05:40 -0800
From:	Tony Lindgren <tony@...mide.com>
To:	Roel Kluin <roel.kluin@...il.com>
Cc:	"linux-omap@...r.kernel.org" <linux-omap@...r.kernel.org>,
	Andrew Morton <akpm@...ux-foundation.org>,
	LKML <linux-kernel@...r.kernel.org>
Subject: Re: [PATCH] OMAP: Should cs be positive in gpmc_cs_free()?

* Roel Kluin <roel.kluin@...il.com> [091101 05:07]:
> The index `cs' is signed, test whether it is negative before
> we release gpmc_cs_mem[cs].
> 
> Signed-off-by: Roel Kluin <roel.kluin@...il.com>
> ---
> Found by code analysis, is it required?

Looks like a valid check to me.

Acked-by: Tony Lindgren <tony@...mide.com>

> 
> diff --git a/arch/arm/mach-omap2/gpmc.c b/arch/arm/mach-omap2/gpmc.c
> index 1587682..c892a54 100644
> --- a/arch/arm/mach-omap2/gpmc.c
> +++ b/arch/arm/mach-omap2/gpmc.c
> @@ -378,7 +378,7 @@ EXPORT_SYMBOL(gpmc_cs_request);
>  void gpmc_cs_free(int cs)
>  {
>  	spin_lock(&gpmc_mem_lock);
> -	if (cs >= GPMC_CS_NUM || !gpmc_cs_reserved(cs)) {
> +	if (cs >= GPMC_CS_NUM || cs < 0 || !gpmc_cs_reserved(cs)) {
>  		printk(KERN_ERR "Trying to free non-reserved GPMC CS%d\n", cs);
>  		BUG();
>  		spin_unlock(&gpmc_mem_lock);
--
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