public inbox for linux-kernel@vger.kernel.org
 help / color / mirror / Atom feed
From: Petr Vandrovec <vandrove@vc.cvut.cz>
To: Jesper Juhl <juhl-lkml@dif.dk>
Cc: linux-kernel@vger.kernel.org, mroos@ut.ee, Riina Kikas <riinak@ut.ee>
Subject: Re: [PATCH 2.6] clean-up: fixes "comparison between signed
Date: Tue, 7 Dec 2004 02:02:59 +0100	[thread overview]
Message-ID: <20041207010259.GA12352@vana.vc.cvut.cz> (raw)
In-Reply-To: <Pine.LNX.4.61.0412062352430.3390@dragon.hygekrogen.localhost>

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))
> 
> 
> 

  reply	other threads:[~2004-12-07  1:03 UTC|newest]

Thread overview: 6+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2004-12-06 21:37 [PATCH 2.6] clean-up: fixes "comparison between signed Petr Vandrovec
2004-12-06 23:09 ` Jesper Juhl
2004-12-07  1:02   ` Petr Vandrovec [this message]
2004-12-07 23:20     ` Jesper Juhl
2004-12-07 23:36       ` Petr Vandrovec
2004-12-08 22:24         ` Jesper Juhl

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20041207010259.GA12352@vana.vc.cvut.cz \
    --to=vandrove@vc.cvut.cz \
    --cc=juhl-lkml@dif.dk \
    --cc=linux-kernel@vger.kernel.org \
    --cc=mroos@ut.ee \
    --cc=riinak@ut.ee \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox