On Tue, 2007-04-10 at 11:17 +0100, David Howells wrote:
> [EMAIL PROTECTED] wrote:
> 
> > + * @limit: the first invalid value
> 
> If this is the case, ...
> 
> > + *
> > + * Like val + len > limit, except with overflow checking.
> > + */
> > +static inline bool val_outside(unsigned long val, unsigned long len,
> > +                          unsigned long limit)
> > +
> > +{
> > +   return val + len > limit || val + len < val;
> 
> ... then shouldn't that be "val + len >= limit"?

You're the second one to ask this.  I'm pretty sure it's still right
(and it's what the old code used to do).

Consider the case where limit is 0xC0000000, val is 0xBFFFFFFF and len
is 1.

Hope that helps,
Rusty.

-
To unsubscribe from this list: send the line "unsubscribe linux-arch" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to