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, 12 Mar 2008 21:41:08 +1100
From:	Ben Nizette <bn@...sdigital.com>
To:	Paul Mundt <lethal@...ux-sh.org>
Cc:	gregkh@...e.de, linux-kernel <linux-kernel@...r.kernel.org>,
	hjk@...utronix.de
Subject: Re: [PATCH] UIO: Implement a UIO interface for the SMX Cryptengine


On Wed, 2008-03-12 at 19:08 +0900, Paul Mundt wrote:
> On Tue, Mar 11, 2008 at 03:57:10PM +1100, Ben Nizette wrote:
> > +
> > +	info->mem[0].size = regs->end - regs->start;
> > +	info->mem[0].memtype = UIO_MEM_PHYS;
> > +
> You have an off-by-1 in the resource size. ioremap and struct resource
> are not equal in their expectations. You probably want to do something
> like:
> 
> 	info->mem[0].size = regs->end - regs->start + 1;
> 	info->mem[0].internal_addr = ioremap(regs->start, info->mem[0].size);
> 	...
> 
You're right, thanks.  I hadn't noticed since we don't actually access
all the way to the end of the region in normal use.

> and make sure that your resource end doesn't overlap with a start address
> of an unrelated resource in your definition. /proc/iomem tends to be
> useful for this.

Yup.  In our case this is fairly easy as the engine just takes up a
whole Chip Select's worth of address space on an AVR32 AT32AP7000.

		--Ben.
--
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