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: <ADE657CA350FB648AAC2C43247A983F001F3820B7EB4@AUSP01VMBX24.collaborationhost.net>
Date:	Tue, 7 Jun 2011 13:27:32 -0500
From:	H Hartley Sweeten <hartleys@...ionengravers.com>
To:	Joe Perches <joe@...ches.com>, Jiri Kosina <trivial@...nel.org>
CC:	"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>
Subject: RE: [PATCH] treewide: Convert uses of struct resource * to
 resource_size(ptr)

On Monday, June 06, 2011 6:05 PM, Joe Perches wrote:
> Done via coccinelle script:
> 
> struct resource *ptr;
> @@
> 
> - ptr->end - ptr->start + 1
> + resource_size(ptr)
> 
> Mostly uncompiled, not enough cross-compilers.
> 
> Signed-off-by: Joe Perches <joe@...ches.com>
> ---
> 
>> I think most of the offenders were caught back in late 2009.
> 
> There are quite a few left...

FWIW, your patch missed a couple...


>  arch/arm/plat-s5p/sysmmu.c                 |    2 +-

	((res->end) - (res->start)) + 1

arch/arm/plat-samsung/pm-check.c

	(u32)(res->end - res->start)+1

arch/mips/pci/ops-tx3927.c

	channel->io_resource->end - channel->io_resource->start;
	channel->mem_resource->end - channel->mem_resource->start;

These two look like they are missing the + 1.

> arch/powerpc/sysdev/ppc4xx_pci.c           |    6 +++---

	res->end + 1 - res->start

drivers/acpi/apei/apei-base.c

	res->end - res->start

There are a couple of these, they look like they are missing the + 1.

drivers/gpio/gpio-u300.c

	memres->end - memres->start

Missing + 1.

drivers/message/i2o/iop.c

	1 + res->end - res->start

drivers/mtd/maps/ixp2000.c

	dev->resource->end - dev->resource->start + 1

drivers/mtd/maps/sa1100-flash.c

	phys = res->start;
	size = res->end - phys + 1;

drivers/rtc/rtc-cmos.c

	ports->end + 1 - ports->start

drivers/rtc/rtc-mrst.c

	iomem->end + 1 - iomem->start

drivers/video/mb862xx/mb862xxfbdrv.c

	1 + par->res->end - par->res->start

drivers/video/mbx/mbxfb.c

	#define res_size(_r) (((_r)->end - (_r)->start) + 1)

drivers/video/msm/mdp.c

	resource->end - resource->start

Missing + 1.

drivers/video/msm/msm_fb.c

	resource->end - resource->start

Missing + 1.


There are also a number that look like:

	res.end - res.start + 1
and
	res.end + 1 - res.start


Regards,
Hartley

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ