lkml.org 
[lkml]   [2003]   [Sep]   [18]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: fix off-by-one error in ioremap()
From
Date
On Fri, 2003-09-12 at 10:15, Linux Kernel Mailing List wrote:
> ChangeSet 1.1063.43.5, 2003/09/12 04:15:36-04:00, len.brown@intel.com
>
> fix off-by-one error in ioremap()
> fixes kernel crash in acpi mode: http://bugzilla.kernel.org/show_bug.cgi?id=1085

> diff -Nru a/arch/i386/mm/ioremap.c b/arch/i386/mm/ioremap.c
> --- a/arch/i386/mm/ioremap.c Wed Sep 17 14:07:31 2003
> +++ b/arch/i386/mm/ioremap.c Wed Sep 17 14:07:31 2003
> @@ -140,7 +140,7 @@
> */
> offset = phys_addr & ~PAGE_MASK;
> phys_addr &= PAGE_MASK;
> - size = PAGE_ALIGN(last_addr) - phys_addr;
> + size = PAGE_ALIGN(last_addr+1) - phys_addr;
>


A bit higher in that function is:

/* Don't allow wraparound or zero size */
last_addr = phys_addr + size - 1;
if (!size || last_addr < phys_addr)
return NULL;


so why do you undo the deliberate -1 there ?
[unhandled content-type:application/pgp-signature]
\
 
 \ /
  Last update: 2005-03-22 13:48    [W:0.931 / U:0.028 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site