Messages in this thread | | | Date | Tue, 7 Dec 2004 02:02:59 +0100 | From | Petr Vandrovec <> | Subject | Re: [PATCH 2.6] clean-up: fixes "comparison between signed |
| |
On Tue, Dec 07, 2004 at 12:09:05AM +0100, Jesper Juhl wrote: > On Mon, 6 Dec 2004, Petr Vandrovec wrote: > > Correct is (if any fix is needed at all) typecast regs->esp to unsigned > > long, > > That would have been my suggestion as well. > > >eventually with check that address is less than (unsigned long)-32, > > as area at VA 0 is not going to grow "down" to 0xFFFFFxxx, even if you > > nicely ask. > > you mean something like this - right?
Yes. Though I believe that we already take vma == NULL path when address is that big. Petr Vandrovec
> Signed-off-by: Jesper Juhl <juhl-lkml@dif.dk> > > diff -up linux-2.6.10-rc3-bk2-orig/arch/i386/mm/fault.c linux-2.6.10-rc3-bk2/arch/i386/mm/fault.c > --- linux-2.6.10-rc3-bk2-orig/arch/i386/mm/fault.c 2004-12-06 22:24:16.000000000 +0100 > +++ linux-2.6.10-rc3-bk2/arch/i386/mm/fault.c 2004-12-07 00:04:33.000000000 +0100 > @@ -305,7 +305,7 @@ fastcall void do_page_fault(struct pt_re > * pusha) doing post-decrement on the stack and that > * doesn't show up until later.. > */ > - if (address + 32 < regs->esp) > + if (address + 32 < (unsigned long)regs->esp || address >= (~0UL - 32)) > goto bad_area; > } > if (expand_stack(vma, address)) > > > - To unsubscribe from this list: send the line "unsubscribe linux-kernel" in the body of a message to majordomo@vger.kernel.org More majordomo info at http://vger.kernel.org/majordomo-info.html Please read the FAQ at http://www.tux.org/lkml/
| |