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:	Wed, 8 Jul 2009 14:41:38 +0200
From:	Sascha Hauer <s.hauer@...gutronix.de>
To:	Julia Lawall <julia@...u.dk>
Cc:	kernel@...gutronix.de, linux-fbdev-devel@...ts.sourceforge.net,
	linux-kernel@...r.kernel.org, kernel-janitors@...r.kernel.org
Subject: Re: [PATCH 2/3] drivers/video/imxfb.c: Fix resource size off by 1
	error

Hi Julia,

On Sat, Jul 04, 2009 at 11:32:29PM +0200, Julia Lawall wrote:
> From: Julia Lawall <julia@...u.dk>
> 
> In the first case, the change is not semantics-preserving, but
> resource_size is used at the corresponding call to request_mem_region in
> the same function.
> 
> In the second case, the change is semantics-preserving.
> 
> The problem was found using the following semantic patch:
> (http://www.emn.fr/x-info/coccinelle/)
> 
> // <smpl>
> @@
> struct resource *res;
> @@
> 
> - (res->end - res->start) + 1
> + resource_size(res)
> 
> @@
> struct resource *res;
> @@
> 
> - res->end - res->start
> + BAD(resource_size(res))
> // </smpl>
> 
> Signed-off-by: Julia Lawall <julia@...u.dk>
> 
> ---
>  drivers/video/imxfb.c |    4 ++--
>  1 file changed, 2 insertions(+), 2 deletions(-)
> 
> diff -u -p a/drivers/video/imxfb.c b/drivers/video/imxfb.c
> --- a/drivers/video/imxfb.c 2009-04-13 16:04:25.000000000 +0200
> +++ b/drivers/video/imxfb.c 2009-07-04 21:37:48.000000000 +0200
> @@ -754,7 +754,7 @@ failed_map:
>  failed_getclock:
>  	iounmap(fbi->regs);
>  failed_ioremap:
> -	release_mem_region(res->start, res->end - res->start);
> +	release_mem_region(res->start, resource_size(res));
>  failed_req:
>  	kfree(info->pseudo_palette);
>  failed_init:
> @@ -785,7 +785,7 @@ static int __devexit imxfb_remove(struct
>  	framebuffer_release(info);
>  
>  	iounmap(fbi->regs);
> -	release_mem_region(res->start, res->end - res->start + 1);
> +	release_mem_region(res->start, resource_size(res));
>  	clk_disable(fbi->clk);
>  	clk_put(fbi->clk);

I already have a patch queued for this issue in imxfb.c

Sascha

-- 
Pengutronix e.K.                           |                             |
Industrial Linux Solutions                 | http://www.pengutronix.de/  |
Peiner Str. 6-8, 31137 Hildesheim, Germany | Phone: +49-5121-206917-0    |
Amtsgericht Hildesheim, HRA 2686           | Fax:   +49-5121-206917-5555 |
--
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